Merge pull request 'fix: check package arguments before applying Nix 2.18 override' (#34) from devusb/nixos-module:remove-devenv-overlay into main

Reviewed-on: lix-project/nixos-module#34
This commit is contained in:
jade 2024-09-18 03:39:56 +00:00
commit daeb420858

View file

@ -21,11 +21,6 @@ let
"nurl"
"prefetch-yarn-deps" # force these onto upstream so we are not regularly rebuilding electron
];
override_2_18 = prev.lib.genAttrs overridelist_2_18 (
name: prev.${name}.override {
nix = final.nixVersions.nix_2_18_upstream;
}
);
inherit (prev) lib;
@ -65,7 +60,12 @@ let
# errors. This is a simple safeguard to put in at least something that might be seen.
maybeWarnWrongMajor = x: if !(lib.hasPrefix supportedLixMajor lixPackageToUse.version) then builtins.trace wrongMajorWarning x else x;
overlay = override_2_18 // {
overlay =
lib.genAttrs overridelist_2_18 (
name: if (lib.functionArgs prev.${name}.override ? "nix") then prev.${name}.override {
nix = final.nixVersions.nix_2_18_upstream;
} else prev.${name}
) // {
lix-overlay-present = 1;
# used for things that one wouldn't necessarily want to update, but we
# nevertheless shove it in the overlay and fixed-point it in case one *does*