Revert temporary fix for "store path ... is not allowed to have references"

The issue is now solved upstream: https://github.com/NixOS/nix/issues/5410
This commit is contained in:
Yuka 2021-11-12 03:29:46 +01:00
parent dbfb1dfc17
commit c698432f2f
Signed by: Yuka
GPG key ID: B95AE06334AFF6BA

View file

@ -6,7 +6,7 @@ cd "$(dirname "$0")"
if ! command -v nix-build &> /dev/null if ! command -v nix-build &> /dev/null
then then
echo "Nix installation could not be found. Please follow the instructions linked below." echo "Nix installation could not be found. Please follow the instructions linked below."
echo "https://nixos.org/manual/nix/unstable/installation/installing-binary.html#multi-user-installation" echo "https://nixos.org/manual/nix/unstable/installation/installing-binary.html"
exit exit
fi fi
@ -24,13 +24,12 @@ fi
echo "deploying $host to $target" echo "deploying $host to $target"
sleep 1 sleep 1
tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT
sources="$tmp/sources"
cp -r $(nix-build nix/sources-dir.nix --no-out-link) $tmp/sources
set -x set -x
system_drv=$(nix-instantiate "<nixpkgs/nixos>" -A config.system.build.toplevel -I $sources -I "nixos-config=$PWD/hosts/$host/configuration.nix") system_drv=$(
nix-instantiate "<nixpkgs/nixos>" -A config.system.build.toplevel \
-I "$(nix-build nix/sources-dir.nix --no-out-link)" \
-I "nixos-config=$PWD/hosts/$host/configuration.nix"
)
nix-copy-closure --to $target $system_drv nix-copy-closure --to $target $system_drv
system=$(ssh $target "nix-store --realise $system_drv") system=$(ssh $target "nix-store --realise $system_drv")
ssh $target "sudo nix-env -p /nix/var/nix/profiles/system -i $system && sudo /nix/var/nix/profiles/system/bin/switch-to-configuration $mode" ssh $target "sudo nix-env -p /nix/var/nix/profiles/system -i $system && sudo /nix/var/nix/profiles/system/bin/switch-to-configuration $mode"