From 04186bcae389b43c3ed8e4054068eb520b3f2349 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Mon, 22 Apr 2024 14:59:54 -0700 Subject: [PATCH] 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: https://git.lix.systems/lix-project/nixos-module/pulls/18 --- overlay.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/overlay.nix b/overlay.nix index 4f5a6c8..930ad10 100644 --- a/overlay.nix +++ b/overlay.nix @@ -24,6 +24,8 @@ let # what commands and whatnot we support, so tell Nixpkgs that we're 2.18 (ish). version = "2.18.3-lix${versionSuffix}"; }; + + inherit (prev) lib; in { # 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 { nix = final.nixVersions.nix_2_18_upstream; }; - prefetch-npm-deps = prev.prefetch-npm-deps.override { - nix = final.nixVersions.nix_2_18_upstream; - }; + + # 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; + } + else prev.prefetch-npm-deps; + nix-prefetch-git = prev.nix-prefetch-git.override { nix = final.nixVersions.nix_2_18_upstream; };