Files
nix-flake/flakes/zen-browser.nix
T
2026-07-02 19:57:24 +01:00

57 lines
1.3 KiB
Nix

{
inputs,
pkgs,
lib,
...
}:
let
extension = shortId: guid: {
name = guid;
value = {
install_url = "https://addons.mozilla.org/en-GB/firefox/downloads/latest/${shortId}/latest.xpi";
installation_mode = "normal_installed";
};
};
prefs = {
# about:config
"extensions.autoDisableScopes" = 0;
"extensions.pocket.enabled" = false;
};
extensions = [
(extension "ublock-origin" "uBlock0@raymonhill.net")
];
in
{
environment.systemPackages = with pkgs; [
(pkgs.wrapFirefox
inputs.zen-browser.packages.${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 = {
Defeault = "ddg";
Add = [
{
Name = "nixpkgs packages";
URLTemplate = "https://search.nixos.org/packages?query={searchTerms}";
IconURL = "https://wiki.nixos.org/favicon.ico";
Alias = "@np";
}
];
};
};
}
)
];
}