firefox: avoid unnecessarily overriding package
When `cfg.package` is already wrapped, and wrapped without the `ExtensionSettings` key set, this would always add that key, even if its value was blank. This would result in `cfg.finalPackage` being a functionally-identical, but differently-input-addressed package. This is generally undesirable as it may result in multiple derivations being built, and also if the value of `cfg.package` is expected to be unchanged by the user (e.g. because they want it to be consistent between NixOS and HM configuration). Add a test to ensure this does not regress in the default case. Only test on newish stateVersion since the logic for `isWrapped` differs on older versions.
This commit is contained in:
parent
1b4f2a4816
commit
bd530df4e2
3 changed files with 33 additions and 6 deletions
|
|
@ -803,12 +803,13 @@ in {
|
|||
finalPackage = wrapPackage cfg.package;
|
||||
|
||||
policies = {
|
||||
ExtensionSettings = listToAttrs (map (lang:
|
||||
nameValuePair "langpack-${lang}@firefox.mozilla.org" {
|
||||
installation_mode = "normal_installed";
|
||||
install_url =
|
||||
"https://releases.mozilla.org/pub/firefox/releases/${cfg.package.version}/linux-x86_64/xpi/${lang}.xpi";
|
||||
}) cfg.languagePacks);
|
||||
ExtensionSettings = lib.mkIf (cfg.languagePacks != [ ]) (listToAttrs (map
|
||||
(lang:
|
||||
nameValuePair "langpack-${lang}@firefox.mozilla.org" {
|
||||
installation_mode = "normal_installed";
|
||||
install_url =
|
||||
"https://releases.mozilla.org/pub/firefox/releases/${cfg.package.version}/linux-x86_64/xpi/${lang}.xpi";
|
||||
}) cfg.languagePacks));
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue