From ae489774aa9f3d0951cf5ae1647f567f146bb1a3 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 3 Nov 2024 22:37:33 +0100 Subject: [PATCH] Download `nixpkgs` only if necessary --- scripts/lib/nix.fish | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/lib/nix.fish b/scripts/lib/nix.fish index d4141acb..f61cb698 100644 --- a/scripts/lib/nix.fish +++ b/scripts/lib/nix.fish @@ -16,8 +16,11 @@ begin function installNixPkgs -V config -V nixPkgsDir source "$config" - if [ ! -d "$nixPkgsCache" ] - downloadNixPkgs + if [ ! -d "$nixPkgsDir" ] + if [ ! -d "$nixPkgsCache" ] + downloadNixPkgs + end + sudo mkdir -p "$nixPkgsDir" sudo cp -r "$nixPkgsCache"/* "$nixPkgsDir" end