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:
parent
4044ad191f
commit
97ac0801d1
1 changed files with 25 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue