From 09a6c9431a3a5d6506dbde976f39ffc5b1dc9521 Mon Sep 17 00:00:00 2001 From: Sean Buckley Date: Sat, 11 Nov 2023 14:02:01 -0500 Subject: [PATCH] skip firefox on servers --- modules/desktop/firefox.nix | 80 +++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/modules/desktop/firefox.nix b/modules/desktop/firefox.nix index 8b62bfe..7d55694 100644 --- a/modules/desktop/firefox.nix +++ b/modules/desktop/firefox.nix @@ -1,44 +1,46 @@ { config, lib, pkgs, ... }: { - environment.systemPackages = [ - (pkgs.wrapFirefox pkgs.firefox-unwrapped { - extraPolicies = { - NewTabPage = false; - CaptivePortal = false; - DisablePocket = true; - DisableFirefoxAccounts = true; - DisableFirefoxStudies = true; - OfferToSaveLogins = false; - DisableFormHistory = true; - SearchSuggestEnabled = false; - Preferences = builtins.mapAttrs - (n: v: { Value = v; Status = "locked"; }) - { - "accessibility.force_disabled" = 1; - "browser.aboutConfig.showWarning" = false; - "browser.contentblocking.category" = "strict"; - "browser.tabs.firefox-view" = false; - "browser.uitour.enabled" = false; - "browser.zoom.siteSpecific" = false; - "extensions.formautofill.addresses.enabled" = false; - "extensions.formautofill.creditCards.enabled" = false; - "extensions.formautofill.heuristics.enabled" = false; - "network.IDN_show_punycode" = true; - "places.history.expiration.max_pages" = 2048; - "ui.key.menuAccessKeyFocuses" = false; - }; - ExtensionSettings = - { "*".installation_mode = "blocked"; } // - builtins.mapAttrs - (n: v: { - installation_mode = "force_installed"; - install_url = "https://addons.mozilla.org/firefox/downloads/latest/${v}/latest.xpi"; - }) + config = lib.mkIf (config.sconfig.desktop.enable) { + environment.systemPackages = [ + (pkgs.wrapFirefox pkgs.firefox-unwrapped { + extraPolicies = { + NewTabPage = false; + CaptivePortal = false; + DisablePocket = true; + DisableFirefoxAccounts = true; + DisableFirefoxStudies = true; + OfferToSaveLogins = false; + DisableFormHistory = true; + SearchSuggestEnabled = false; + Preferences = builtins.mapAttrs + (n: v: { Value = v; Status = "locked"; }) { - "jid1-KKzOGWgsW3Ao4Q@jetpack" = "i-dont-care-about-cookies"; - "{446900e4-71c2-419f-a6a7-df9c091e268b}" = "bitwarden-password-manager"; + "accessibility.force_disabled" = 1; + "browser.aboutConfig.showWarning" = false; + "browser.contentblocking.category" = "strict"; + "browser.tabs.firefox-view" = false; + "browser.uitour.enabled" = false; + "browser.zoom.siteSpecific" = false; + "extensions.formautofill.addresses.enabled" = false; + "extensions.formautofill.creditCards.enabled" = false; + "extensions.formautofill.heuristics.enabled" = false; + "network.IDN_show_punycode" = true; + "places.history.expiration.max_pages" = 2048; + "ui.key.menuAccessKeyFocuses" = false; }; - }; - }) - ]; + ExtensionSettings = + { "*".installation_mode = "blocked"; } // + builtins.mapAttrs + (n: v: { + installation_mode = "force_installed"; + install_url = "https://addons.mozilla.org/firefox/downloads/latest/${v}/latest.xpi"; + }) + { + "jid1-KKzOGWgsW3Ao4Q@jetpack" = "i-dont-care-about-cookies"; + "{446900e4-71c2-419f-a6a7-df9c091e268b}" = "bitwarden-password-manager"; + }; + }; + }) + ]; + }; }