From c560b6f769eec4212335b22ed048e4a96ef14724 Mon Sep 17 00:00:00 2001 From: Kiara Grouwstra Date: Sun, 24 Aug 2025 22:58:17 +0200 Subject: [PATCH] simplify deployment --- deployment/check/data-model/nixosTest.nix | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/deployment/check/data-model/nixosTest.nix b/deployment/check/data-model/nixosTest.nix index b58af9b7..e9f57e2d 100644 --- a/deployment/check/data-model/nixosTest.nix +++ b/deployment/check/data-model/nixosTest.nix @@ -77,23 +77,18 @@ in import ${pathToRoot}/deployment/nixos.nix { inherit configuration; } ' ) - # instantiate the config in /nix/store - "''${command[@]}" -A out_path - # get the other info - json="$("''${command[@]}" --eval --strict --json)" # DEPLOY - declare drv_path - # set our variables using the json object - eval "export $(echo $json | jq -r 'to_entries | map("\(.key)=\(.value)") | @sh')" host="root@${nodeName}" sshOpts=( -o StrictHostKeyChecking=no -o "ConnectTimeout=1" -o "ServerAliveInterval=1" ) + # instantiate the config in /nix/store + "''${command[@]}" -A out_path # get the realized derivation to deploy - outPath=$(nix-store --realize "$drv_path") + outPath=$(nix-store --realize "$("''${command[@]}" --eval --strict --json | jq -r '.drv_path')") # deploy the config by nix-copy-closure NIX_SSHOPTS="''${sshOpts[*]}" nix-copy-closure --to "$host" "$outPath" --gzip --use-substitutes # switch the remote host to the config