From 30a55ac796ef586851b3ad2d21381e3b7dd20d4e Mon Sep 17 00:00:00 2001 From: kenji Date: Mon, 30 Jun 2025 13:35:51 -0500 Subject: [PATCH] fixed browser --- hosts/desktop/configuration.nix | 1 + modules/de.nix | 11 ++++ modules/system.nix | 1 - system/browser.nix | 107 ++++++++++++++++++++++++++++++++ 4 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 modules/de.nix create mode 100644 system/browser.nix diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix index 09d0242..1823dce 100644 --- a/hosts/desktop/configuration.nix +++ b/hosts/desktop/configuration.nix @@ -11,6 +11,7 @@ ./hardware-configuration.nix ../../modules/linuxDev.nix ../../modules/system.nix + ../../modules/de.nix ] ++ lib.optionals (myConfig.linux.apps.gaming == true) [ ]; diff --git a/modules/de.nix b/modules/de.nix new file mode 100644 index 0000000..b891220 --- /dev/null +++ b/modules/de.nix @@ -0,0 +1,11 @@ +{ + lib, + myConfig, + ... +}: { + imports = [ + ../system/font.nix + ../system/browser.nix + ../system/wayland.nix + ]; +} diff --git a/modules/system.nix b/modules/system.nix index 9d74b5e..5acf820 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -9,6 +9,5 @@ ../system/tty.nix ../system/firewall.nix ../system/boot.nix - ../system/font.nix ]; } diff --git a/system/browser.nix b/system/browser.nix new file mode 100644 index 0000000..ddfd024 --- /dev/null +++ b/system/browser.nix @@ -0,0 +1,107 @@ +{ + config, + pkgs, + ... +}: let + lock-false = { + Value = false; + Status = "locked"; + }; + lock-true = :q + Value = true; + Status = "locked"; + }; +in { + programs = { + firefox = { + enable = true; + languagePacks = ["en-US"]; + + /* + ---- POLICIES ---- + */ + # Check about:policies#documentation for options. + policies = { + DisableTelemetry = true; + DisableFirefoxStudies = true; + EnableTrackingProtection = { + Value = true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; + DisablePocket = true; + DisableFirefoxAccounts = true; + DisableAccounts = true; + DisableFirefoxScreenshots = true; + OverrideFirstRunPage = ""; + OverridePostUpdatePage = ""; + DontCheckDefaultBrowser = true; + DisplayBookmarksToolbar = "never"; # alternatives: "always" or "newtab" + DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on" + SearchBar = "unified"; # alternative: "separate" + + /* + ---- EXTENSIONS ---- + */ + # Check about:support for extension/add-on ID strings. + # Valid strings for installation_mode are "allowed", "blocked", + # "force_installed" and "normal_installed". + ExtensionSettings = { + "*".installation_mode = "blocked"; # blocks all addons except the ones specified below + # uBlock Origin: + "uBlock0@raymondhill.net" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + installation_mode = "force_installed"; + }; + "{446900e4-71c2-419f-a6a7-df9c091e268b}" = { + install_url = "https://addons.mozilla.org/firefox/downloads/file/4493940/bitwarden_password_manager-2025.5.0.xpi"; + installation_mode = "force_installed"; + }; + "tridactyl.vim@cmcaine.co.uk" = { + install_url = "https://addons.mozilla.org/firefox/downloads/file/4405615/tridactyl_vim-1.24.2.xpi"; + installation_mode = "force_installed"; + }; + # Privacy Badger: + # "jid1-MnnxcxisBPnSXQ@jetpack" = { + # install_url = "https://addons.mozilla.org/firefox/downloads/latest/privacy-badger17/latest.xpi"; + # installation_mode = "force_installed"; + # }; + # 1Password: + # "{d634138d-c276-4fc8-924b-40a0ea21d284}" = { + # install_url = "https://addons.mozilla.org/firefox/downloads/latest/1password-x-password-manager/latest.xpi"; + # installation_mode = "force_installed"; + }; + }; + + /* + ---- PREFERENCES ---- + */ + # Check about:config for options. + preferences = { + # "browser.contentblocking.category" = { + # Value = "strict"; + # Status = "locked"; + # }; + "browser.contentblocking.category" = "strict"; + "extensions.pocket.enabled" = false; + "extensions.screenshots.disabled" = true; + "browser.topsites.contile.enabled" = false; + "browser.formfill.enable" = false; + "browser.search.suggest.enabled" = false; + "browser.search.suggest.enabled.private" = false; + "browser.urlbar.suggest.searches" = false; + "browser.urlbar.showSearchSuggestionsFirst" = false; + "browser.newtabpage.activity-stream.feeds.section.topstories" = false; + "browser.newtabpage.activity-stream.feeds.snippets" = false; + "browser.newtabpage.activity-stream.section.highlights.includePocket" = false; + "browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = false; + "browser.newtabpage.activity-stream.section.highlights.includeDownloads" = false; + "browser.newtabpage.activity-stream.section.highlights.includeVisited" = false; + "browser.newtabpage.activity-stream.showSponsored" = false; + "browser.newtabpage.activity-stream.system.showSponsored" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + }; + }; + }; +}