diff --git a/flake.nix b/flake.nix index 104f6f1..1f8c058 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + firefox-addons = { + url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + # Declarative partitioning and formatting disko = { url = "github:nix-community/disko"; diff --git a/home/common/optional/firefox.nix b/home/common/optional/firefox.nix new file mode 100644 index 0000000..ac075a6 --- /dev/null +++ b/home/common/optional/firefox.nix @@ -0,0 +1,95 @@ +{ config, pkgs, ... }: + + let + lock-false = { + Value = false; + Status = "locked"; + }; + lock-true = { + Value = true; + Status = "locked"; + }; + in +{ + programs = { + firefox = { + enable = true; + languagePacks = [ "gb" "en-GB" ]; + search.engines = { + "Searxng" = { + urls = [{ + template = "http://10.0.10.35:8855"; + }]; + }; + }; + /* ---- 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"; + }; + # 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"; }; + "extensions.pocket.enabled" = lock-false; + "extensions.screenshots.disabled" = lock-true; + "browser.topsites.contile.enabled" = lock-false; + "browser.formfill.enable" = lock-false; + "browser.search.suggest.enabled" = lock-false; + "browser.search.suggest.enabled.private" = lock-false; + "browser.urlbar.suggest.searches" = lock-false; + "browser.urlbar.showSearchSuggestionsFirst" = lock-false; + "browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false; + "browser.newtabpage.activity-stream.feeds.snippets" = lock-false; + "browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false; + "browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false; + "browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false; + "browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false; + "browser.newtabpage.activity-stream.showSponsored" = lock-false; + "browser.newtabpage.activity-stream.system.showSponsored" = lock-false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false; + }; + }; + }; + }; +} diff --git a/home/sparky.nix b/home/sparky.nix index a95e303..6c45593 100644 --- a/home/sparky.nix +++ b/home/sparky.nix @@ -10,6 +10,7 @@ ./common/core ./common/optional/sops.nix + ./common/optional/firefox.nix # Import optional ./common/optional/git.nix diff --git a/home/users/media/default.nix b/home/users/media/default.nix index c62ec54..5e03f87 100644 --- a/home/users/media/default.nix +++ b/home/users/media/default.nix @@ -14,7 +14,7 @@ createDirectories = false; desktop = "/home/media/Desktop"; documents = null; - download = null; + download = "/home/media/Downloads"; music = null; pictures = null; publicShare = null;