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:
glmlm
2026-06-18 08:17:43 -05:00
committed by GitHub
parent 5ccd408ca7
commit 6274683ee4
+11 -5
View File
@@ -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 { };