From 656f21e84966b64563e44810fbccee37dd5008ad Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 5 Dec 2024 18:19:18 +0100 Subject: [PATCH] Allow commits as nix versions --- scripts/lib/nix.fish | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/lib/nix.fish b/scripts/lib/nix.fish index 76f1fc99..670c8f89 100644 --- a/scripts/lib/nix.fish +++ b/scripts/lib/nix.fish @@ -11,8 +11,12 @@ begin source "$config" if ! __isNixModule "$nixPkgsCache" - mkdir -p "$nixPkgsCache" - and git clone https://github.com/NixOS/nixpkgs.git --depth=1 -b "$nixPkgsVersion" "$nixPkgsCache" + rm -rf "$nixPkgsCache" + and mkdir -p "$nixPkgsCache" + and git -C "$nixPkgsCache" init + and git -C "$nixPkgsCache" remote add origin https://github.com/NixOS/nixpkgs.git + and git -C "$nixPkgsCache" fetch --depth=1 origin "$nixPkgsVersion" + and git -C "$nixPkgsCache" reset --hard FETCH_HEAD and rm -rf "$nixPkgsCache/.git" end end