Update librewolf.nix
This commit is contained in:
@@ -8,24 +8,6 @@ let
|
||||
DisablePocket = true;
|
||||
DisableFirefoxAccounts = true;
|
||||
|
||||
FirefoxHome = {
|
||||
Search = true;
|
||||
TopSites = true;
|
||||
SponsoredTopSites = false;
|
||||
Highlights = false;
|
||||
Pocket = false;
|
||||
SponsoredPocket = false;
|
||||
};
|
||||
|
||||
SanitizeOnShutdown = {
|
||||
Cache = true;
|
||||
Cookies = false;
|
||||
History = false;
|
||||
Sessions = true;
|
||||
SiteSettings = false;
|
||||
OfflineApps = true;
|
||||
};
|
||||
|
||||
ExtensionSettings = {
|
||||
"{446900e4-71c2-419f-a6a7-df9c091e268b}" = {
|
||||
install_url = "https://addons.mozilla.org/firefox/downloads/latest/bitwarden-password-manager/latest.xpi";
|
||||
@@ -39,71 +21,49 @@ let
|
||||
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
|
||||
installation_mode = "force_installed";
|
||||
};
|
||||
"{15cb5e64-94bd-41aa-91cf-751bb1a84972}" = {
|
||||
install_url = "https://addons.mozilla.org/firefox/downloads/latest/catppuccin-macchiato-lavender2/latest.xpi";
|
||||
installation_mode = "force_installed";
|
||||
};
|
||||
};
|
||||
|
||||
Preferences = {
|
||||
"browser.startup.homepage" = {
|
||||
Value = "about:home";
|
||||
Status = "locked";
|
||||
};
|
||||
"extensions.autoDisableScopes" = {
|
||||
Value = 0;
|
||||
Status = "locked";
|
||||
};
|
||||
"browser.toolbars.bookmarks.visibility" = {
|
||||
Value = "always";
|
||||
Status = "locked";
|
||||
};
|
||||
"network.cookie.cookieBehavior" = {
|
||||
Value = 1;
|
||||
Status = "locked";
|
||||
};
|
||||
"privacy.clearOnShutdown.cookies" = {
|
||||
Value = false;
|
||||
Status = "locked";
|
||||
};
|
||||
"privacy.clearOnShutdown.history" = {
|
||||
Value = false;
|
||||
Status = "locked";
|
||||
};
|
||||
"sidebar.revamp" = {
|
||||
Value = true;
|
||||
Status = "locked";
|
||||
};
|
||||
"sidebar.verticalTabs" = {
|
||||
Value = true;
|
||||
Status = "locked";
|
||||
};
|
||||
"sidebar.main.tools" = {
|
||||
Value = "bookmarks,history,tabs";
|
||||
Status = "locked";
|
||||
};
|
||||
"sidebar.visibility" = {
|
||||
Value = "always";
|
||||
Status = "locked";
|
||||
};
|
||||
"extensions.activeThemeID" = {
|
||||
Value = "{1d573fb2-437c-4440-9b7b-b72a3eaec105}";
|
||||
Status = "locked";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
policiesFile = pkgs.writeText "librewolf-policies.json" policiesJson;
|
||||
|
||||
autoconfigLoader = pkgs.writeText "autoconfig.js" ''
|
||||
pref("general.config.filename", "autoconfig.cfg");
|
||||
pref("general.config.obscure_value", 0);
|
||||
'';
|
||||
|
||||
autoconfigCfg = pkgs.writeText "autoconfig.cfg" ''
|
||||
// First line must be a comment
|
||||
lockPref("extensions.activeThemeID", "firefox-alpenglow@mozilla.org");
|
||||
|
||||
// Other stubborn prefs can go here if needed
|
||||
lockPref("sidebar.revamp", true);
|
||||
lockPref("sidebar.verticalTabs", true);
|
||||
'';
|
||||
|
||||
in
|
||||
{
|
||||
system.activationScripts.postActivation.text = ''
|
||||
DIST_DIR="/Applications/LibreWolf.app/Contents/Resources/distribution"
|
||||
if [ -d "/Applications/LibreWolf.app" ]; then
|
||||
APP_DIR="/Applications/LibreWolf.app"
|
||||
if [ -d "$APP_DIR" ]; then
|
||||
echo ">>> Applying LibreWolf Policies & AutoConfig..."
|
||||
|
||||
DIST_DIR="$APP_DIR/Contents/Resources/distribution"
|
||||
mkdir -p "$DIST_DIR"
|
||||
cp ${policiesFile} "$DIST_DIR/policies.json"
|
||||
cp -f ${policiesFile} "$DIST_DIR/policies.json"
|
||||
chmod 644 "$DIST_DIR/policies.json"
|
||||
echo "LibreWolf policies applied."
|
||||
|
||||
PREF_DIR="$APP_DIR/Contents/Resources/defaults/pref"
|
||||
mkdir -p "$PREF_DIR"
|
||||
cp -f ${autoconfigLoader} "$PREF_DIR/autoconfig.js"
|
||||
chmod 644 "$PREF_DIR/autoconfig.js"
|
||||
|
||||
cp -f ${autoconfigCfg} "$APP_DIR/Contents/Resources/autoconfig.cfg"
|
||||
chmod 644 "$APP_DIR/Contents/Resources/autoconfig.cfg"
|
||||
|
||||
echo ">>> Done."
|
||||
else
|
||||
echo ">>> LibreWolf.app not found. Skipping."
|
||||
fi
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user