# SPDX-FileCopyrightText: 2026 Nitesh Kumar Debnath # # SPDX-License-Identifier: GPL-3.0-or-later { inputs, 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; "zen.widget.linux.transparency" = 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") # ... ]; extraPolicies = { DNSOverHTTPS = { Enabled = false; ProviderURL = "https://jmfa1wa82x.cloudflare-gateway.com/dns-query"; }; DisableTelemetry = true; Preferences = prefs |> lib.mapAttrs ( _: Value: { inherit Value; Status = "locked"; } ); ExtensionSettings = builtins.listToAttrs extensions; SearchEngines = { Default = "ddg"; 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"; } ]; }; }; firefox-wrapper = pkgs: pkgs.wrapFirefox (inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.beta-unwrapped.override { inherit extraPolicies; }) { icon = "zen-browser"; }; in { perSystem = { pkgs, ... }: { packages.zen-wrapped = firefox-wrapper pkgs; }; flake.modules.nixos.pc = { unstablePkgs, config, ... }: { environment.systemPackages = [ (firefox-wrapper unstablePkgs) inputs.helium-browser.packages.${config.nixpkgs.hostPlatform.system}.default ]; }; }