config.nix/modules/internet/browser/zen-browser.nix
martyTF bf430f5b71 honestly just wayyy too muchz
liek media and stuff
and fixing shit
and iinstalling adblock on browser by default

cool shiz
2025-12-22 08:15:54 +01:00

80 lines
2.3 KiB
Nix

{
config,
lib,
pkgs,
inputs,
...
}:
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;
"general.autoScroll" = true;
"general.smoothScroll" = true;
"middlemouse.contentLoadURL" = false;
# ...
};
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 "adnauseam" "adnauseam@rednoise.org")
(extension "floccus" "floccus@handmadeideas.org")
(extension "bitwarden-password-manager" "{446900e4-71c2-419f-a6a7-df9c091e268b}")
(extension "simplelogin" "addon@simplelogin")
(extension "localcdn-fork-of-decentraleyes" "{b86e4813-687a-43e6-ab65-0bde4ab75758}")
(extension "catppuccin-web-file-icons" "{bbb880ce-43c9-47ae-b746-c3e0096c5b76}")
# ...
];
in
{
options = {
internet.browsers = {
zen-browser = {
enable = lib.mkEnableOption "enable zen-browser";
};
};
};
config = lib.mkIf config.internet.browsers.zen-browser.enable {
home.packages = [
(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 = "MartyTF's Series of Tubes";
Add = [
{
Name = "MartyTF's Series of Tubes";
URLTemplate = "https://search.marty.tf/?q={searchTerms}";
IconURL = "https://wiki.nixos.org/favicon.ico";
Alias = "@sgx";
}
];
};
};
}
)
];
};
}