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 { plugins = mkOption {
type = types.attrsOf types.str; type = types.attrsOf types.str;
default = {}; 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,20 +9,24 @@ in {
languagePacks = [ "de" "en-US" ]; languagePacks = [ "de" "en-US" ];
policies = { policies = {
ExtensionSettings = lib.mkMerge [ ExtensionSettings = lib.mkMerge [
{} # global rules. Potentially add blocking of regularly installed addons here. (lib.mkIf cfg.firefox.disableUserPlugins {
(lib.mapAttrs (uid: url: { # explicit plugins by config "*".installation_mode = "blocked";
install_url = url; } )
(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"; installation_mode = "force_installed";
} ) cfg.firefox.plugins ) } ) cfg.firefox.plugins )
(lib.mkIf (cfg.tooling.enable && cfg.tooling.pass) { # password-store support (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"; install_url = "https://addons.mozilla.org/firefox/downloads/latest/passff/latest.xpi";
installation_mode = "force_installed"; installation_mode = "force_installed";
};
}) })
]; ];
DisableTelemetry = true; DisableTelemetry = true;
DisableFirefoxStudies = true; DisableFirefoxStudies = true;
EnableTrackingProtection = { EnableTrackingProtection = {
Value= true; Value = true;
Locked = true; Locked = true;
Cryptomining = true; Cryptomining = true;
Fingerprinting = true; Fingerprinting = true;