diff --git a/modules/programs/default.nix b/modules/programs/default.nix index b4ea9a7..dd09437 100644 --- a/modules/programs/default.nix +++ b/modules/programs/default.nix @@ -23,6 +23,7 @@ ./keepassxc.nix ./gaming.nix ./stylix.nix + ./firefox.nix ./hyprland ]; } diff --git a/modules/programs/firefox.nix b/modules/programs/firefox.nix new file mode 100644 index 0000000..55ea9ba --- /dev/null +++ b/modules/programs/firefox.nix @@ -0,0 +1,69 @@ +{ lib, config, options, pkgs, ... }: { + options.mods.firefox = { + enable = lib.mkOption { + default = true; + example = false; + type = lib.types.bool; + description = "Enables firefox"; + }; + configuration = lib.mkOption { + default = { + EnableTrackingProtection = { + Value = true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; + DisablePocket = true; + DisplayBookmarksToolbar = "never"; + DisplayMenuBar = "default-off"; + CaptivePortal = false; + DisableFirefoxStudies = true; + DisableTelemetry = true; + DisableFirefoxAccounts = false; + NoDefaultBookmarks = true; + OfferToSaveLogins = false; + OfferToSaveLoginsDefault = false; + PasswordManagerEnabled = false; + FirefoxHome = { + Search = true; + Pocket = false; + Snippets = false; + TopSites = true; + Highlights = false; + }; + UserMessaging = { + ExtensionRecommendations = false; + SkipOnboarding = true; + }; + }; + example = { }; + type = with lib.types; attrsOf anything; + description = "Firefox policy configuration"; + }; + extensions = lib.mkOption { + default = with pkgs.nur.repos.rycee.firefox-addons;[ + ublock-origin + darkreader + privacy-badger + vimium + keepassxc-browser + i-dont-care-about-cookies + tokyo-night-v2 + ]; + example = [ ]; + type = with lib.types; listOf package; + description = "Firefox extensions (from nur)"; + }; + }; + config = lib.mkIf config.mods.firefox.enable + (lib.optionalAttrs (options?programs.firefox.profiles) { + programs.firefox = { + enable = true; + policies = config.mods.firefox.configuration; + profiles.${config.conf.username} = { + extensions = config.mods.firefox.extensions; + }; + }; + }); +} diff --git a/programs/individual_configs/default.nix b/programs/individual_configs/default.nix index 40470cc..74b5582 100644 --- a/programs/individual_configs/default.nix +++ b/programs/individual_configs/default.nix @@ -4,7 +4,6 @@ ./yazi.nix ./fish.nix ./direnv.nix - ./firefox.nix ./neovide.nix ]; } diff --git a/programs/individual_configs/firefox.nix b/programs/individual_configs/firefox.nix deleted file mode 100644 index 098f01e..0000000 --- a/programs/individual_configs/firefox.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ pkgs, config, ... }: { - programs.firefox = { - enable = true; - - policies = { - EnableTrackingProtection = { - Value = true; - Locked = true; - Cryptomining = true; - Fingerprinting = true; - }; - DisablePocket = true; - DisplayBookmarksToolbar = "never"; - DisplayMenuBar = "default-off"; - CaptivePortal = false; - DisableFirefoxStudies = true; - DisableTelemetry = true; - DisableFirefoxAccounts = false; - NoDefaultBookmarks = true; - OfferToSaveLogins = false; - OfferToSaveLoginsDefault = false; - PasswordManagerEnabled = false; - FirefoxHome = { - Search = true; - Pocket = false; - Snippets = false; - TopSites = true; - Highlights = false; - }; - UserMessaging = { - ExtensionRecommendations = false; - SkipOnboarding = true; - }; - }; - profiles.${config.conf.username} = { - extensions = with pkgs.nur.repos.rycee.firefox-addons; [ - ublock-origin - darkreader - privacy-badger - vimium - keepassxc-browser - i-dont-care-about-cookies - tokyo-night-v2 - ]; - }; - }; -}