{ inputs, pkgs, lib, ... }: let extension = shortId: guid: { name = guid; value = { install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi"; installation_mode = "normal_installed"; }; }; prefs = { # Check these out at about:config "extensions.autoDisableScopes" = 0; "extensions.pocket.enabled" = false; "browser.ctrlTab.sortByRecentlyUsed" = true; "browser.urlbar.resultMenu.keyboardAccessible" = false; "privacy.sanitize.sanitizeOnShutdown" = true; "sidebar.visibility" = "hide-sidebar"; "zen.view.compact.enable-at-startup" = true; "zen.welcome-screen.seen" = true; }; extensions = [ # To add additional extensions, find it on addons.mozilla.org, find # the short ID in the url (like https://addons.mozilla.org/en-US/firefox/addon/!SHORT_ID!/) # Then go to https://addons.mozilla.org/api/v5/addons/addon/!SHORT_ID!/ to get the guid (extension "ublock-origin" "uBlock0@raymondhill.net") (extension "darkreader" "addon@darkreader.org") (extension "kagi-search-for-firefox" "search@kagi.com") (extension "proton-pass" "78272b6fa58f4a1abaac99321d503a20@proton.me") ]; in { environment.systemPackages = [ (pkgs.wrapFirefox inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.zen-browser-unwrapped { extraPrefs = lib.concatLines ( lib.mapAttrsToList ( name: value: ''lockPref(${lib.strings.toJSON name}, ${lib.strings.toJSON value});'' ) prefs ); extraPolicies = { DisableTelemetry = true; ExtensionSettings = builtins.listToAttrs extensions; SearchEngines = { Default = "Kagi"; Add = [ { Name = "nixpkgs packages"; URLTemplate = "https://search.nixos.org/packages?query={searchTerms}"; IconURL = "https://wiki.nixos.org/favicon.ico"; Alias = "@np"; } { Name = "NixOS options"; URLTemplate = "https://search.nixos.org/options?query={searchTerms}"; IconURL = "https://wiki.nixos.org/favicon.ico"; Alias = "@no"; } { Name = "NixOS Wiki"; URLTemplate = "https://wiki.nixos.org/w/index.php?search={searchTerms}"; IconURL = "https://wiki.nixos.org/favicon.ico"; Alias = "@nw"; } { Name = "noogle"; URLTemplate = "https://noogle.dev/q?term={searchTerms}"; IconURL = "https://noogle.dev/favicon.ico"; Alias = "@ng"; } ]; }; }; } ) ]; }