diff options
| author | Martin Fischer <martin@push-f.com> | 2025-12-07 12:00:11 +0100 |
|---|---|---|
| committer | Martin Fischer <martin@push-f.com> | 2025-12-07 12:47:13 +0100 |
| commit | 756f21e959e48c53a7685fa1431e68b0c78b7231 (patch) | |
| tree | a420113fd45531a8bb28dfec25d7a46f7570a574 /nixos | |
| parent | 5af0605675adc29c6ae9795ca339d0346b5fdf8d (diff) | |
refactor(workstation): set Firefox preferences via extraPrefs
Diffstat (limited to 'nixos')
| -rw-r--r-- | nixos/profiles/workstation/graphical.nix | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/nixos/profiles/workstation/graphical.nix b/nixos/profiles/workstation/graphical.nix index 8058d26..b09108c 100644 --- a/nixos/profiles/workstation/graphical.nix +++ b/nixos/profiles/workstation/graphical.nix @@ -81,6 +81,27 @@ programs.firefox = { enable = true; + package = + let + prefs = { + # about:config preferences + # We're setting them via extraPrefs because policies.Preferences doesn't support all about:config preferences. + "browser.aboutConfig.showWarning" = false; + "browser.tabs.insertAfterCurrent" = true; + "browser.uidensity" = 1; + "extensions.activeThemeID" = "firefox-compact-dark@mozilla.org"; # can be changed via UI despite this about:config setting being locked + "layout.css.devPixelsPerPx" = "1.2"; # with this the default Firefox font size matches my terminal font size of 14px + }; + in + (pkgs.wrapFirefox pkgs.firefox-unwrapped { + extraPrefs = with pkgs.lib; '' + ${concatStrings ( + mapAttrsToList (name: value: '' + lockPref("${name}", ${builtins.toJSON value}); + '') prefs + )} + ''; + }); policies = { DontCheckDefaultBrowser = true; @@ -93,14 +114,6 @@ # cannot use SearchEngines because it's only available on ESR :( # (https://mozilla.github.io/policy-templates/#searchengines-this-policy-is-only-available-on-the-esr) - Preferences = { - "layout.css.devPixelsPerPx" = "1.2"; # with this the default Firefox font size matches my terminal font size of 14px - "browser.tabs.insertAfterCurrent" = true; - "browser.uidensity" = 1; - "browser.aboutConfig.showWarning" = false; - "extensions.activeThemeID" = "firefox-compact-dark@mozilla.org"; # can be changed via UI despite this about:config setting being locked - }; - ExtensionSettings = { "uBlock0@raymondhill.net" = { install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; |
