From 9a803c98a32d2a9a29cb813d98ab1a90a20f11e7 Mon Sep 17 00:00:00 2001 From: maralorn Date: Mon, 13 Mar 2023 15:32:31 +0100 Subject: [PATCH] Fix update-system script --- overlays/update-system.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/overlays/update-system.nix b/overlays/update-system.nix index c5d8e4ce..89f9e0a1 100644 --- a/overlays/update-system.nix +++ b/overlays/update-system.nix @@ -82,10 +82,8 @@ final: _: let set -e remote_host=$1 host=''${remote_host:-$(hostname)} - echo "Evaluating configuration for $host …" - outputDrv=$(nix eval --raw $HOME/git/config#nixosConfigurations.$host.config.system.build.toplevel.drvPath) echo "Building configuration for $host …" - output=$(nom build --builders @$(builders-configurator) $outputDrv --no-link --print-out-paths) + output=$(nom build --builders @$(builders-configurator) $HOME/git/config#nixosConfigurations.$host.config.system.build.toplevel --no-link --print-out-paths) if [[ -z "$remote_host" ]]; then on_target() { /run/wrappers/bin/sudo $@ @@ -94,8 +92,10 @@ final: _: let on_target() { ${pkgs.lib.getExe pkgs.openssh} root@$host $@ } + echo "Uploading derivation to $host …" + ${final.lib.getExe pkgs.nix} copy --derivation $output --to ssh://$host echo "Uploading configuration to $host …" - ${final.lib.getExe pkgs.nix} copy $outputDrv $output --to ssh://$host + ${final.lib.getExe pkgs.nix} copy $output --to ssh://$host fi on_target ${pkgs.nix}/bin/nix-env -p /nix/var/nix/profiles/system --set $output on_target $output/bin/switch-to-configuration switch