{ lib, config, pkgs, ... }: let cfg = config.suites.desktop; in { config = lib.mkIf cfg.enable { programs.firefox = lib.mkIf cfg.firefox.enable { enable = true; nativeMessagingHosts = []; # pkgs.firefoxpwa removed. I use ungoogled-chromiums PWA Implementation for better stability. policies = { # --------- Privacy --------- DisableTelemetry = true; DisableFirefoxStudies = true; DisablePocket = true; DisableFirefoxAccounts = true; AutofillAddressEnabled = false; AutofillCreditCardEnabled = false; OfferToSaveLogins = false; FirefoxHome.TopSites = false; FirefoxHome.SponsoredTopSites = false; Preferences = { "browser.newtabpage.pinned" = { Value = ""; Status = "locked"; }; "browser.topsites.contile.enabled" = { Value = false; Status = "locked"; }; }; # -------- Opiniated -------- DontCheckDefaultBrowser = true; DisableProfileImport = true; SearchBar = "unified"; SearchEngines.Add = [ # Only Available in ESR Releases https://mozilla.github.io/policy-templates/#searchengines--add { Name = "Brave"; URLTemplate = "https://search.brave.com/search?q={searchTerms}"; Alias = "br"; IconURL = "https://cdn.search.brave.com/serp/v3/_app/immutable/assets/brave-search-icon.CsIFM2aN.svg"; } ]; # Extensions https://mozilla.github.io/policy-templates#extensionsettings ExtensionSettings = { "uBlock0@raymondhill.net" = lib.mkIf (cfg.firefox.disableuBlockOrigin == false) { # uBlock Origin: https://addons.mozilla.org/en-US/firefox/addon/ublock-origin install_url = "https://addons.mozilla.org/firefox/downloads/file/4598854/ublock_origin-1.67.0.xpi"; installation_mode = "normal_installed"; private_browsing = true; }; "idcac-pub@guus.ninja" = lib.mkIf (cfg.firefox.disableIDontCareAboutCookies == false) { # I still don't care about cookies: https://addons.mozilla.org/en-US/firefox/addon/istilldontcareaboutcookies/ install_url = "https://addons.mozilla.org/firefox/downloads/file/4613590/istilldontcareaboutcookies-1.1.8.xpi"; installation_mode = "normal_installed"; private_browsing = true; }; "keepassxc-browser@keepassxc.org" = lib.mkIf (cfg.firefox.disableKeepassxcBrowser == false) { # KeePassXC-Browser: https://addons.mozilla.org/en-US/firefox/addon/keepassxc-browser install_url = "https://addons.mozilla.org/firefox/downloads/file/4592023/keepassxc_browser-1.9.10.xpi"; installation_mode = "normal_installed"; }; "offline-qr-code@rugk.github.io" = lib.mkIf (cfg.firefox.disableOfflineQr == false) { # Offline QR Code Generator: https://addons.mozilla.org/en-US/firefox/addon/offline-qr-code-generator/ install_url = "https://addons.mozilla.org/firefox/downloads/file/4349427/offline_qr_code_generator-1.9.xpi"; installation_mode = "normal_installed"; }; "addon@darkreader.org" = lib.mkIf (cfg.firefox.disableDarkReader == false) { # Dark Reader: https://addons.mozilla.org/en-US/firefox/addon/darkreader/ install_url = "https://addons.mozilla.org/firefox/downloads/file/4625542/darkreader-4.9.116.xpi"; installation_mode = "normal_installed"; }; "languagetool-webextension@languagetool.org" = lib.mkIf (cfg.firefox.disableLanguageTool == false) { # LanguageTool: https://addons.mozilla.org/en-US/firefox/addon/languagetool install_url = "https://addons.mozilla.org/firefox/downloads/file/4538560/languagetool-9.0.1.xpi"; installation_mode = "normal_installed"; }; }; Bookmarks = lib.mkIf (cfg.firefox.disableDefaultBookmarks == false) [ { Title = "Syncthing"; URL = "localhost:8384"; Placement = "toolbar"; } { Title = "NixOS Search - Packages"; URL = "https://search.nixos.org/packages?channel=unstable"; Placement = "toolbar"; Folder = "NixOS"; } { Title = "NixOS Search - Options"; URL = "https://search.nixos.org/options?channel=unstable"; Placement = "toolbar"; Folder = "NixOS"; } { Title = "Home Manager Search - Options"; URL = "https://home-manager-options.extranix.com/?release=master"; Placement = "toolbar"; Folder = "NixOS"; } { Title = "Lix"; URL = "https://lix.systems/"; Placement = "toolbar"; Folder = "NixOS"; } { Title = "AUX - Homepage"; URL = "https://auxolotl.org/en/"; Placement = "toolbar"; Folder = "NixOS"; } { Title = "AUX - Forum"; URL = "https://forum.aux.computer/"; Placement = "toolbar"; Folder = "NixOS"; } { Title = "Nix Pills"; URL = "https://nixos.org/guides/nix-pills/"; Placement = "toolbar"; Folder = "NixOS"; } ]; }; }; }; }