2024-08-01 21:22:47 +02:00
|
|
|
{ lib, pkgs, config, ... }: let
|
|
|
|
inherit (lib) mkIf mkEnableOption mkOption types;
|
2024-08-01 22:11:12 +02:00
|
|
|
cfg = config.chuj.stuff.firefox;
|
|
|
|
user = config.chuj.system.user;
|
2024-08-01 21:22:47 +02:00
|
|
|
in {
|
|
|
|
options.chuj.stuff.firefox = {
|
|
|
|
enable = mkEnableOption "firefox";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2024-09-17 15:45:36 +02:00
|
|
|
home-manager.users.${user}.programs.firefox = {
|
2024-08-01 21:22:47 +02:00
|
|
|
enable = true;
|
2024-10-16 11:40:24 +02:00
|
|
|
package = pkgs.firefox-bin;
|
2024-08-01 21:22:47 +02:00
|
|
|
policies = {
|
|
|
|
DisableTelemetry = true;
|
|
|
|
DisableFirefoxStudies = true;
|
|
|
|
EnableTrackingProtection = {
|
|
|
|
Value = true;
|
|
|
|
Locked = true;
|
|
|
|
Cryptomining = true;
|
|
|
|
Fingerprinting = true;
|
|
|
|
};
|
|
|
|
DisablePocket = true;
|
|
|
|
DisableFirefoxAccounts = true;
|
|
|
|
DisableAccounts = true;
|
|
|
|
DisableFirefoxScreenshots = true;
|
|
|
|
OverridePostUpdatePage = "";
|
|
|
|
DontCheckDefaultBrowser = true;
|
|
|
|
DisplayBookmarksToolbar = "always";
|
|
|
|
DisplayMenuBar = "default-off";
|
|
|
|
SearchBar = "unified";
|
2024-08-01 22:11:12 +02:00
|
|
|
DefaultDownloadDirectory = config.home-manager.users.${user}.xdg.userDirs.download;
|
2024-08-01 21:22:47 +02:00
|
|
|
ExtensionSettings = {
|
|
|
|
# ublock origin
|
|
|
|
"uBlock0@raymondhill.net" = {
|
|
|
|
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
|
2024-10-13 11:01:57 +02:00
|
|
|
installation_mode = "normal_installed";
|
2024-08-01 21:22:47 +02:00
|
|
|
};
|
|
|
|
# youtube redux
|
|
|
|
"{2d4c0962-e9ff-4cad-8039-9a8b80d9b8b6}" = {
|
|
|
|
install_url = "https://addons.mozilla.org/firefox/downloads/file/4224361/latest.xpi";
|
2024-10-13 11:01:57 +02:00
|
|
|
installation_mode = "normal_installed";
|
2024-08-01 21:22:47 +02:00
|
|
|
};
|
|
|
|
# sponsorblock
|
|
|
|
"sponsorBlocker@ajay.app" = {
|
|
|
|
install_url = "https://addons.mozilla.org/firefox/downloads/file/4251917/latest.xpi";
|
2024-10-13 11:01:57 +02:00
|
|
|
installation_mode = "normal_installed";
|
2024-08-01 21:22:47 +02:00
|
|
|
};
|
|
|
|
# legacy wikipedia layout
|
|
|
|
"{484f3bc9-b13b-4498-8ea6-124c199c5ca8}" = {
|
|
|
|
install_url = "https://addons.mozilla.org/firefox/downloads/file/4100662/latest.xpi";
|
2024-10-13 11:01:57 +02:00
|
|
|
installation_mode = "normal_installed";
|
2024-08-01 21:22:47 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-09-17 15:45:36 +02:00
|
|
|
profiles.${user} = {
|
2024-08-01 21:22:47 +02:00
|
|
|
id = 0;
|
|
|
|
isDefault = true;
|
|
|
|
search = {
|
|
|
|
default = "envs.net - SearXNG";
|
|
|
|
force = true;
|
|
|
|
engines = {
|
|
|
|
"envs.net - SearXNG" = {
|
|
|
|
urls = [ { template = "https://searx.envs.net/searxng/search?q={searchTerms}"; } ];
|
|
|
|
icon = "https://envs.net/favicon.ico";
|
|
|
|
iconUpdateURL = "https://envs.net/favicon.ico";
|
|
|
|
updateInterval = 24 * 60 * 60 * 1000;
|
|
|
|
definedAliases = [ "@sx" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
# searx sometimes sucks
|
|
|
|
"Google".metaData.alias = "@g";
|
|
|
|
|
|
|
|
"Wikipedia (en)".metaData.alias = "@w";
|
2024-08-01 22:11:12 +02:00
|
|
|
"Wikipedia (pl)" = {
|
|
|
|
urls = [ { template = "https://pl.wikipedia.org/w/index.php?search={searchTerms}"; } ];
|
|
|
|
icon = "https://pl.wikipedia.org/static/favicon/wikipedia.ico";
|
|
|
|
iconUpdateURL = "https://pl.wikipedia.org/static/favicon/wikipedia.ico";
|
|
|
|
updateInterval = 24 * 60 * 60 * 1000;
|
|
|
|
definedAliases = [ "@wpl" ];
|
|
|
|
};
|
2024-08-01 21:22:47 +02:00
|
|
|
|
|
|
|
"Nix Packages" = {
|
|
|
|
urls = [ { template = "https://search.nixos.org/packages?channel=unstable&query={searchTerms}"; } ];
|
|
|
|
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
|
|
|
definedAliases = [ "@np" ];
|
|
|
|
};
|
|
|
|
"Nix Options" = {
|
|
|
|
urls = [ { template = "https://search.nixos.org/options?channel=unstable&query={searchTerms}"; } ];
|
|
|
|
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
|
|
|
definedAliases = [ "@no" ];
|
|
|
|
};
|
|
|
|
"Home Manger" = {
|
|
|
|
urls = [ { template = "https://home-manager-options.extranix.com/?release=master&query={searchTerms}"; } ];
|
|
|
|
icon = "https://home-manager-options.extranix.com/images/favicon.png";
|
|
|
|
iconUpdateURL = "https://home-manager-options.extranix.com/images/favicon.png";
|
|
|
|
updateInterval = 24 * 60 * 60 * 1000;
|
|
|
|
definedAliases = [ "@hm" ];
|
|
|
|
};
|
|
|
|
"Arch Wiki" = {
|
|
|
|
urls = [ { template = "https://wiki.archlinux.org/index.php?search={searchTerms}"; } ];
|
|
|
|
icon = "https://wiki.archlinux.org/favicon.ico";
|
|
|
|
iconUpdateURL = "https://wiki.archlinux.org/favicon.ico";
|
|
|
|
updateInterval = 24 * 60 * 60 * 1000;
|
|
|
|
definedAliases = [ "@aw" ];
|
|
|
|
};
|
|
|
|
"NixOS Wiki" = {
|
2024-08-01 22:11:12 +02:00
|
|
|
urls = [ { template = "https://wiki.nixos.org/w/index.php?search={searchTerms}"; } ];
|
2024-08-01 21:22:47 +02:00
|
|
|
icon = "https://nixos.wiki/favicon.png";
|
|
|
|
iconUpdateURL = "https://nixos.wiki/favicon.png";
|
|
|
|
updateInterval = 24 * 60 * 60 * 1000;
|
|
|
|
definedAliases = [ "@nw" ];
|
|
|
|
};
|
2024-08-01 22:11:12 +02:00
|
|
|
"Noogle" = {
|
|
|
|
urls = [ { template = "https://noogle.dev/q?term={searchTerms}"; } ];
|
|
|
|
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
|
|
|
definedAliases = [ "@ng" ];
|
|
|
|
};
|
|
|
|
"Wolfram Alpha" = {
|
|
|
|
urls = [ { template = "https://www.wolframalpha.com/input?i={searchTerms}"; } ];
|
|
|
|
icon = "https://www.wolframalpha.com/_next/static/images/favicon_1zbE9hjk.ico";
|
|
|
|
iconUpdateURL = "https://www.wolframalpha.com/_next/static/images/favicon_1zbE9hjk.ico";
|
|
|
|
updateInterval = 24 * 60 * 60 * 1000;
|
|
|
|
definedAliases = [ "@wa" ];
|
|
|
|
};
|
2024-08-01 21:22:47 +02:00
|
|
|
|
|
|
|
# the rest can fuck off
|
|
|
|
"Bing".metaData.hidden = true;
|
|
|
|
"DuckDuckGo".metaData.hidden = true;
|
|
|
|
"eBay".metaData.hidden = true; # ??? who up ebaying they firegfox
|
|
|
|
};
|
|
|
|
};
|
|
|
|
settings = {
|
|
|
|
"extensions.activeThemeID" = "firefox-compact-dark@mozilla.org";
|
|
|
|
"services.sync.prefs.sync.extensions.activeThemeID" = "false";
|
2024-08-01 22:11:12 +02:00
|
|
|
"middlemouse.paste" = "false";
|
2024-08-02 19:42:56 +02:00
|
|
|
"browser.download.dir" = config.home-manager.users.${user}.xdg.userDirs.download;
|
2024-08-01 21:22:47 +02:00
|
|
|
# https://git.jacekpoz.pl/jacekpoz/niksos/src/branch/master/modules/gui/firefox.nix#L405
|
|
|
|
# but modified (a bit)
|
|
|
|
"browser.aboutConfig.showWarning" = false;
|
2024-08-01 22:11:12 +02:00
|
|
|
"browser.startup.page" = 3;
|
2024-08-01 21:22:47 +02:00
|
|
|
"browser.startup.homepage" = "about:home";
|
|
|
|
"browser.newtabpage.enabled" = true;
|
|
|
|
"browser.newtabpage.activity-stream.showSponsored" = false;
|
|
|
|
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
|
|
|
|
"browser.newtabpage.activity-stream.default.sites" = "";
|
|
|
|
"extensions.getAddons.showPane" = false;
|
|
|
|
"extensions.htmlaboutaddons.recommendations.enabled" = false;
|
|
|
|
"browser.discovery.enabled" = false;
|
|
|
|
"extensions.unifiedExtensions.enabled" = false;
|
|
|
|
"datareporting.policy.dataSubmissionEnabled" = false;
|
|
|
|
"datareporting.healthreport.uploadEnabled" = false;
|
|
|
|
"toolkit.telemetry.unified" = false;
|
|
|
|
"toolkit.telemetry.enabled" = false;
|
|
|
|
"toolkit.telemetry.server" = "data:,";
|
|
|
|
"toolkit.telemetry.archive.enabled" = false;
|
|
|
|
"toolkit.telemetry.newProfilePing.enabled" = false;
|
|
|
|
"toolkit.telemetry.shutdownPingSender.enabled" = false;
|
|
|
|
"toolkit.telemetry.updatePing.enabled" = false;
|
|
|
|
"toolkit.telemetry.bhrPing.enabled" = false;
|
|
|
|
"toolkit.telemetry.firstShutdownPing.enabled" = false;
|
|
|
|
"toolkit.telemetry.coverage.opt-out" = true;
|
|
|
|
"toolkit.coverage.endpoint.base" = "";
|
|
|
|
"browser.ping-centre.telemetry" = false;
|
|
|
|
"browser.newtabpage.activity-stream.feeds.telemetry" = false;
|
|
|
|
"browser.newtabpage.activity-stream.telemetry" = false;
|
|
|
|
"app.shield.optoutstudies.enabled" = false;
|
|
|
|
"app.normandy.enabled" = false;
|
|
|
|
"app.normandy.api_url" = "";
|
|
|
|
"breakpad.reportURL" = "";
|
|
|
|
"browser.tabs.crashReporting.sendReport" = false;
|
|
|
|
"browser.crashReports.unsubmittedCheck.enabled" = false;
|
|
|
|
"browser.crashReports.unsubmittedCheck.autoSubmit2" = false;
|
|
|
|
"captivedetect.canonicalURL" = "";
|
|
|
|
"network.captive-portal-service.enabled" = false;
|
|
|
|
"network.connectivity-service.enabled" = false;
|
|
|
|
"browser.safebrowsing.malware.enabled" = false;
|
|
|
|
"browser.safebrowsing.phishing.enabled" = false;
|
|
|
|
"browser.safebrowsing.downloads.enabled" = false;
|
|
|
|
"browser.safebrowsing.downloads.remote.enabled" = false;
|
|
|
|
"browser.safebrowsing.downloads.remote.url" = "";
|
|
|
|
"browser.safebrowsing.downloads.remote.block_potentially_unwanted" = false;
|
|
|
|
"browser.safebrowsing.downloads.remote.block_uncommon" = false;
|
|
|
|
"browser.safebrowsing.allowOverride" = false;
|
|
|
|
"privacy.resistFingerprinting.block_mozAddonManager" = true;
|
|
|
|
|
|
|
|
"gfx.webrender.all" = true;
|
|
|
|
# "media.ffmpeg.vaapi.enabled" = true;
|
|
|
|
|
|
|
|
# "identity.sync.tokenserver.uri" = "https://ffsync.jacekpoz.pl/1.0/sync/1.5";
|
|
|
|
|
|
|
|
"dom.private-attribution.submission.enabled" = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|