From 396cad8c1c54b07dc1649d0c23daa118b3e88719 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sun, 23 Jun 2024 18:03:26 -0400 Subject: [PATCH] firefox: add sane default extensions and settings --- homeManagerModules/apps/firefox/default.nix | 109 +++++++++++++++++++- 1 file changed, 108 insertions(+), 1 deletion(-) diff --git a/homeManagerModules/apps/firefox/default.nix b/homeManagerModules/apps/firefox/default.nix index fc68ed9d..de95ef69 100644 --- a/homeManagerModules/apps/firefox/default.nix +++ b/homeManagerModules/apps/firefox/default.nix @@ -5,6 +5,113 @@ ... }: { config = lib.mkIf config.alyraffauf.apps.firefox.enable { - programs.firefox = {enable = true;}; + programs.firefox = { + enable = true; + nativeMessagingHosts = lib.optionals (config.alyraffauf.apps.keepassxc.enable) [pkgs.keepassxc]; + + policies = { + Cookies.Behavior = "reject-foreign"; + DisableFirefoxStudies = true; + DisableMasterPasswordCreation = true; + DisablePocket = true; + DisableProfileImport = true; + DisableSetDesktopBackground = true; + DisableTelemetry = true; + DisplayBookmarksToolbar = "newtab"; + + DNSOverHTTPS = { + Enabled = true; + Fallback = true; + }; + + DontCheckDefaultBrowser = true; + + EnableTrackingProtection = { + Cryptomining = true; + Fingerprinting = true; + EmailTracking = true; + Locked = false; + Value = true; + }; + + EncryptedMediaExtensions = { + Enabled = true; + Locked = false; + }; + + ExtensionSettings = + { + "uBlock0@raymondhill.net" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + installation_mode = "normal_installed"; + }; + "jid1-BoFifL9Vbdl2zQ@jetpack" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/decentraleyes/latest.xpi"; + installation_mode = "normal_installed"; + }; + } + // lib.attrsets.optionalAttrs (config.alyraffauf.apps.keepassxc.enable) { + "keepassxc-browser@keepassxc.org" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/keepassxc-browser/latest.xpi"; + installation_mode = "normal_installed"; + }; + }; + + FirefoxHome = { + Highlights = false; + Locked = false; + Pocket = false; + Search = true; + Snippets = false; + SponsoredPocket = false; + SponsoredTopSites = false; + TopSites = false; + }; + + FirefoxSuggest = { + ImproveSuggest = false; + Locked = false; + SponsoredSuggestions = false; + WebSuggestions = false; + }; + + HardwareAcceleration = true; + + Homepage = { + Locked = false; + StartPage = "previous-session"; + }; + + NewTabPage = false; + NoDefaultBookmarks = true; + OfferToSaveLoginsDefault = false; + OverrideFirstRunPage = ""; + OverridePostUpdatePage = ""; + + PDFjs = { + Enabled = true; + EnablePermissions = false; + }; + + Preferences = { + "browser.aboutConfig.showWarning" = false; + "browser.bookmarks.addedImportButton" = false; + "datareporting.healthreport.uploadEnabled" = false; + "datareporting.policy.dataSubmissionPolicyAccepted" = true; + "datareporting.policy.firstRunURL" = ""; + "dom.security.https_only_mode" = true; + "extensions.autoDisableScopes" = 0; + }; + + UserMessaging = { + ExtensionRecommendations = false; + FeatureRecommendations = false; + MoreFromMozilla = false; + SkipOnboarding = true; + }; + + UseSystemPrintDialog = true; + }; + }; }; }