Handle nix cache properly

This commit is contained in:
Manuel Thalmann 2024-11-03 00:39:23 +01:00
parent 46540b9a9d
commit 0182aa1fa5

View file

@ -15,12 +15,15 @@ begin
function installNixPkgs -V config -V nixPkgsDir function installNixPkgs -V config -V nixPkgsDir
source "$config" source "$config"
if [ ! -d "$nixPkgsCache" ]
downloadNixPkgs downloadNixPkgs
mkdir -p "$nixPkgsDir" mkdir -p "$nixPkgsDir"
cp -r "$nixPkgsCache"/* "$nixPkgsDir" cp -r "$nixPkgsCache"/* "$nixPkgsDir"
end end
end
function uninstallNixPkgs -V nixPkgsDir function uninstallNixPkgs -V nixPkgsDir
rm -rf "$nixPkgsDir" rm -rf (dirname "$nixPkgsDir")
end end
end end