summaryrefslogtreecommitdiff
path: root/hm/soft/librewolf/browser.nix
diff options
context:
space:
mode:
authoradikro <adikro@disroot.org>2026-03-17 23:25:22 +0100
committeradikro <adikro@disroot.org>2026-03-17 23:25:22 +0100
commite7549665587b1e4a11225bce0c70ff74fe171e5f (patch)
treef502cebd865ca728ede83c8fb30e30bbb44f67ea /hm/soft/librewolf/browser.nix
parent2e7f564763826013eeff22ecfce99c462829e2ec (diff)
some age key shenanigans
Diffstat (limited to 'hm/soft/librewolf/browser.nix')
-rw-r--r--hm/soft/librewolf/browser.nix176
1 files changed, 176 insertions, 0 deletions
diff --git a/hm/soft/librewolf/browser.nix b/hm/soft/librewolf/browser.nix
new file mode 100644
index 0000000..b67d71f
--- /dev/null
+++ b/hm/soft/librewolf/browser.nix
@@ -0,0 +1,176 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+let
+ cfg = config.hm.soft.browser;
+in
+{
+ options.hm.soft.browser = {
+ librewolf.enable = lib.mkEnableOption "LibreWolf browser";
+ brave.enable = lib.mkEnableOption "Brave browser";
+ };
+ config = lib.mkMerge [
+ (lib.mkIf cfg.librewolf.enable {
+ programs.librewolf = {
+ enable = true;
+ settings = {
+ "toolkit.legacyUserProfileCustomizations.stylesheets" = true;
+ };
+
+ profiles = {
+ main = {
+ id = 0;
+ name = "main";
+ isDefault = true;
+ search = {
+ force = true;
+ engines = {
+ "SearXNG" = {
+ urls = [ { template = "https://sxng.violets-purgatory.dev/search?q={searchTerms}"; } ];
+ definedAliases = [ "@s" ];
+ };
+ "NixOS Packages" = {
+ urls = [ { template = "https://search.nixos.org/packages?channel=unstable&query={searchTerms}"; } ];
+ icon = "";
+ definedAliases = [ "@np" ];
+ };
+ "NixOS Options" = {
+ urls = [ { template = "https://search.nixos.org/options?channel=unstable&query={searchTerms}"; } ];
+ icon = "";
+ definedAliases = [ "@no" ];
+ };
+ "Home Manager Options" = {
+ urls = [
+ { template = "https://home-manager-options.extranix.com/?query={searchTerms}&release=master"; }
+ ];
+ definedAliases = [ "@hm" ];
+ };
+ };
+ };
+ extensions = {
+ force = true;
+ packages = with pkgs.nur.repos.rycee.firefox-addons; [
+ (pkgs.callPackage ./extensions/keepass-tusk.nix { })
+ (pkgs.callPackage ./extensions/popup-blocker.nix { })
+ (pkgs.callPackage ./extensions/user-agent-switcher.nix { })
+ link-cleaner
+ privacy-badger
+ to-deepl
+ vimium
+ link-cleaner
+ languagetool
+ sidebery
+ bitwarden
+ buster-captcha-solver
+ sponsorblock
+ dearrow
+ darkreader
+ violentmonkey
+ i-dont-care-about-cookies
+ keepassxc-browser
+ noscript
+ privacy-settings
+ protondb-for-steam
+ steam-database
+ terms-of-service-didnt-read
+ unpaywall
+ ];
+ };
+ settings = {
+ "identity.fxaccounts.enabled" = true;
+
+ # --- Privacy & Fingerprinting ---
+ "privacy.resistFingerprinting" = true;
+ "privacy.fingerprintingProtection" = true;
+ "privacy.query_stripping.enabled" = true;
+ "privacy.query_stripping.enabled.pbmode" = true;
+ "privacy.trackingprotection.enabled" = true;
+ "privacy.trackingprotection.socialtracking.enabled" = true;
+ "privacy.trackingprotection.emailtracking.enabled" = true;
+ "privacy.bounceTrackingProtection.mode" = 1;
+ "privacy.annotate_channels.strict_list.enabled" = true;
+ "privacy.clearOnShutdown_v2.formdata" = true;
+
+ # --- Data Collection & Form Security ---
+ "dom.forms.autocomplete.formautofill" = false;
+ "signon.management.page.breach-alerts.enabled" = false;
+ "browser.translations.enable" = false;
+ "browser.region.update.enabled" = false;
+
+ # --- Search & URL Bar ---
+ "browser.urlbar.shortcuts.bookmarks" = false;
+ "browser.urlbar.shortcuts.history" = false;
+ "browser.urlbar.shortcuts.tabs" = false;
+ "browser.urlbar.shortcuts.actions" = false;
+ "browser.urlbar.showSearchTerms.enabled" = false;
+
+ # --- Networking & Performance ---
+ "network.proxy.type" = 0;
+ "network.prefetch-next" = false;
+ "network.predictor.enabled" = false;
+ "network.http.speculative-parallel-limit" = 0;
+ "network.early-hints.preconnect.max_connections" = 0;
+ "network.connectivity-service.enabled" = false;
+ "network.captive-portal-service.enabled" = false;
+ "security.tls.enable_0rtt_data" = false;
+
+ # --- Interface & De-clutter ---
+ "browser.startup.page" = 3;
+ "browser.startup.homepage" = "chrome://browser/content/blanktab.html";
+ "browser.newtabpage.enabled" = false;
+ "browser.newtabpage.activity-stream.showSearch" = false;
+ "browser.newtabpage.activity-stream.showSponsoredCheckboxes" = false;
+ "browser.bookmarks.restore_default_bookmarks" = false;
+ "media.hardwaremediakeys.enabled" = false;
+ "media.videocontrols.picture-in-picture.video-toggle.enabled" = false;
+ "layout.spellcheckDefault" = 0;
+
+ # --- Safe Browsing (Privacy Trade-off) ---
+ "browser.safebrowsing.downloads.remote.enabled" = false;
+ "browser.safebrowsing.downloads.remote.block_potentially_unwanted" = false;
+ "browser.safebrowsing.downloads.remote.block_uncommon" = false;
+ };
+ userChrome = ''
+ #TabsToolbar { visibility: collapse !important; }
+ #sidebar-header { display: none !important; }
+ #toolbar-menubar { display: none !important; }
+ '';
+ };
+ privacy = {
+ id = 1;
+ name = "privacy";
+ settings = {
+ "media.peerconnection.enabled" = false;
+ "network.proxy.type" = 1;
+
+ "network.proxy.http" = "127.0.0.1";
+ "network.proxy.http_port" = 4444;
+
+ "network.proxy.ssl" = "127.0.0.1";
+ "network.proxy.ssl_port" = 4444;
+
+ "network.proxy.no_proxies_on" = "localhost, 127.0.0.1";
+
+ "network.http.proxy.pipelining" = true;
+ "network.proxy.share_proxy_settings" = true;
+
+ "network.prefetch-next" = false;
+ "network.dns.disablePrefetch" = true;
+ };
+ userChrome = ''
+ #TabsToolbar { visibility: collapse !important; }
+ #sidebar-header { display: none !important; }
+ #toolbar-menubar { display: none !important; }
+ '';
+ };
+ };
+ };
+ })
+ (lib.mkIf cfg.brave.enable {
+ home.packages = [ pkgs.brave ];
+ })
+ ];
+}