fix and simplify firefoy addon management

This commit is contained in:
LordGrimmauld 2024-03-17 11:29:04 +01:00
parent 0631f9ca99
commit 4e74bc033b
2 changed files with 17 additions and 7 deletions

View File

@ -76,7 +76,13 @@ in {
plugins = mkOption {
type = types.attrsOf types.str;
default = {};
description = "set of plugins to install. Format: uid = url";
description = "set of plugins to install. Format: guid = short-id";
};
disableUserPlugins = mkOption {
type = types.bool;
default = false;
description = "disables user controlled plugins";
};
};
};

View File

@ -9,14 +9,18 @@ in {
languagePacks = [ "de" "en-US" ];
policies = {
ExtensionSettings = lib.mkMerge [
{} # global rules. Potentially add blocking of regularly installed addons here.
(lib.mapAttrs (uid: url: { # explicit plugins by config
install_url = url;
(lib.mkIf cfg.firefox.disableUserPlugins {
"*".installation_mode = "blocked";
} )
(lib.mapAttrs (guid: shortId: { # explicit plugins by config
install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi";
installation_mode = "force_installed";
} ) cfg.firefox.plugins )
(lib.mkIf (cfg.tooling.enable && cfg.tooling.pass) { # password-store support
"passff@invicem.pro" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/passff/latest.xpi";
installation_mode = "force_installed";
};
})
];
DisableTelemetry = true;