mkFirefoxModule: add warning for dropped options on wrapped packages
Warns only if the package lacks a `cfg` override and relevant options are configured. References https://github.com/nix-community/home-manager/pull/9486
This commit is contained in:
@@ -195,14 +195,20 @@ let
|
||||
if package == null then
|
||||
null
|
||||
else if isWrapped then
|
||||
package.override (
|
||||
old:
|
||||
lib.optionalAttrs (lib.functionArgs package.override ? cfg) {
|
||||
if lib.functionArgs package.override ? cfg then
|
||||
package.override (old: {
|
||||
cfg = old.cfg or { } // fcfg;
|
||||
extraPolicies = (old.extraPolicies or { }) // cfg.policies;
|
||||
pkcs11Modules = (old.pkcs11Modules or [ ]) ++ cfg.pkcs11Modules;
|
||||
}
|
||||
)
|
||||
})
|
||||
else
|
||||
let
|
||||
droppedPolicies = cfg.policies != { } && (!isDarwin || cfg.darwinDefaultsId == null);
|
||||
droppedOptions = droppedPolicies || cfg.pkcs11Modules != [ ] || cfg.enableGnomeExtensions;
|
||||
in
|
||||
lib.warnIf droppedOptions
|
||||
"${moduleName}: '${browserName}' cannot be reconfigured; 'policies', 'pkcs11Modules', and 'enableGnomeExtensions' will not be applied."
|
||||
package
|
||||
else
|
||||
(pkgs.wrapFirefox.override { config = bcfg; }) package { };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user