Fix eval on nixos-unstable following prefetch-npm-deps dep fix

See: https://github.com/NixOS/nixpkgs/pull/304913

We want to support older nixpkgs too, so we feature detect if we need to
apply this change.

Closes: lix-project/nixos-module#18
This commit is contained in:
jade 2024-04-22 14:59:54 -07:00
parent d47d5dca07
commit 04186bcae3

View file

@ -24,6 +24,8 @@ let
# what commands and whatnot we support, so tell Nixpkgs that we're 2.18 (ish). # what commands and whatnot we support, so tell Nixpkgs that we're 2.18 (ish).
version = "2.18.3-lix${versionSuffix}"; version = "2.18.3-lix${versionSuffix}";
}; };
inherit (prev) lib;
in in
{ {
# used for things that one wouldn't necessarily want to update, but we # used for things that one wouldn't necessarily want to update, but we
@ -54,9 +56,15 @@ in
prefetch-yarn-deps = prev.prefetch-yarn-deps.override { prefetch-yarn-deps = prev.prefetch-yarn-deps.override {
nix = final.nixVersions.nix_2_18_upstream; nix = final.nixVersions.nix_2_18_upstream;
}; };
prefetch-npm-deps = prev.prefetch-npm-deps.override {
# support both having and missing https://github.com/NixOS/nixpkgs/pull/304913
prefetch-npm-deps =
if (lib.functionArgs prev.prefetch-npm-deps.override) ? nix
then prev.prefetch-npm-deps.override {
nix = final.nixVersions.nix_2_18_upstream; nix = final.nixVersions.nix_2_18_upstream;
}; }
else prev.prefetch-npm-deps;
nix-prefetch-git = prev.nix-prefetch-git.override { nix-prefetch-git = prev.nix-prefetch-git.override {
nix = final.nixVersions.nix_2_18_upstream; nix = final.nixVersions.nix_2_18_upstream;
}; };