1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-06 16:57:03 +00:00

firefox: prevent extensions settings override (#6490)

Prevents extensions settings from accidentally being overriden when
using `profiles.<name>.extensions.settings`. Adds the
`profiles.<name>.extensions.force` option to acknowledge the risk.
This commit is contained in:
bricked 2025-02-18 21:24:24 +00:00 committed by GitHub
parent 4044ad191f
commit 97ac0801d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -703,6 +703,17 @@ in {
'';
};
force = mkOption {
description = ''
Whether to override all previous firefox settings.
This is required when using `settings`.
'';
default = false;
example = true;
type = types.bool;
};
settings = mkOption {
default = { };
example = literalExpression ''
@ -829,7 +840,20 @@ in {
(mkNoDuplicateAssertion cfg.profiles "profile")
] ++ (mapAttrsToList
(_: profile: mkNoDuplicateAssertion profile.containers "container")
cfg.profiles);
cfg.profiles) ++ (mapAttrsToList (profileName: profile: {
assertion = profile.extensions.settings == { }
|| profile.extensions.force;
message = ''
Using '${
lib.showAttrPath
(modulePath ++ [ "profiles" profileName "extensions" "settings" ])
}' will override all previous extensions settings.
Enable '${
lib.showAttrPath
(modulePath ++ [ "profiles" profileName "extensions" "force" ])
}' to acknowledge this.
'';
}) cfg.profiles);
warnings = optional (cfg.enableGnomeExtensions or false) ''
Using '${moduleName}.enableGnomeExtensions' has been deprecated and