summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSeth Flynn <[email protected]>2025-03-04 13:55:13 -0500
committerSeth Flynn <[email protected]>2025-03-04 13:55:13 -0500
commit13c164fd38bcc7e00ff5430bd0a4c4c9c4ed5beb (patch)
treee76fef0fcc16518a69277c0785cb94815b82888e /modules
parentf1241cdcd8a7fb6a24ac349570bfecc3caf1b727 (diff)
{nixos,home,darwin}/firefox-addons: use `force_installed` by default
Diffstat (limited to 'modules')
-rw-r--r--modules/shared/firefox-addons.nix30
1 files changed, 5 insertions, 25 deletions
diff --git a/modules/shared/firefox-addons.nix b/modules/shared/firefox-addons.nix
index 17b7293..8ec9e77 100644
--- a/modules/shared/firefox-addons.nix
+++ b/modules/shared/firefox-addons.nix
@@ -34,7 +34,7 @@ let
"force_installed"
"normal_installed"
];
- default = "normal_installed";
+ default = "force_installed";
description = ''
Installation mode for the addon.
See <link xlink:href="https://mozilla.github.io/policy-templates/#extensionsettings"/>.
@@ -61,26 +61,12 @@ let
};
}
);
-
- # Ensure all addons given are submodules describing the `ExtensionSettings` object
- normalizeAddon =
- extensionIdOrSubmodule:
- if lib.isString extensionIdOrSubmodule then
- {
- id = extensionIdOrSubmodule;
- settings = {
- installation_mode = "normal_installed";
- install_url = installURLFromId extensionIdOrSubmodule;
- };
- }
- else
- extensionIdOrSubmodule;
in
{
options.programs.firefox = {
addons = lib.mkOption {
- type = lib.types.listOf (lib.types.either lib.types.str extensionSettingsSubmodule);
+ type = lib.types.listOf extensionSettingsSubmodule;
default = { };
description = ''
List of addon IDs from addons.mozilla.org or configuration
@@ -93,12 +79,12 @@ in
{
settings = {
- installation_mode = "force_installed";
+ installation_mode = "normal_installed";
};
}
# Bitwarden
- "{446900e4-71c2-419f-a6a7-df9c091e268b}"
+ { id = "{446900e4-71c2-419f-a6a7-df9c091e268b}"; }
]
'';
};
@@ -107,13 +93,7 @@ in
config = {
programs.firefox.policies = {
ExtensionSettings = lib.foldl' (lib.flip (
- addon:
-
- let
- normalizedAddon = normalizeAddon addon;
- in
-
- lib.recursiveUpdate { ${normalizedAddon.id} = normalizedAddon.settings; }
+ addon: lib.recursiveUpdate { ${addon.id} = addon.settings; }
)) { } cfg.addons;
};
};