From 4d85dd96f2f99dfef51f97084f50146819bae2f7 Mon Sep 17 00:00:00 2001 From: Kiara Grouwstra Date: Sat, 23 Aug 2025 12:10:45 +0200 Subject: [PATCH] ditch superfluous substituters --- deployment/check/data-model/nixosTest.nix | 11 ++--------- paste | 21 ++------------------- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/deployment/check/data-model/nixosTest.nix b/deployment/check/data-model/nixosTest.nix index beaa9c20..2a85a0a8 100644 --- a/deployment/check/data-model/nixosTest.nix +++ b/deployment/check/data-model/nixosTest.nix @@ -84,8 +84,6 @@ in in # import "${pathToRoot}/deployment/nixos.nix" {} { - substituters = builtins.concatStringsSep " " os.config.nix.settings.substituters; - trusted_public_keys = builtins.concatStringsSep " " os.config.nix.settings.trusted-public-keys; drv_path = os.config.system.build.toplevel.drvPath; out_path = os.config.system.build.toplevel; } @@ -97,21 +95,16 @@ in json="$("''${command[@]}" --eval --strict --json)" # DEPLOY - declare substituters trusted_public_keys drv_path + 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}" - buildArgs=( - --option extra-binary-caches https://cache.nixos.org/ - --option substituters $substituters - --option trusted-public-keys $trusted_public_keys - ) sshOpts=( -o BatchMode=yes -o StrictHostKeyChecking=no ) # get the realized derivation to deploy - outPath=$(nix-store --realize "$drv_path" "''${buildArgs[@]}") + outPath=$(nix-store --realize "$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 diff --git a/paste b/paste index 4a115c24..25e6190f 100644 --- a/paste +++ b/paste @@ -1,12 +1,9 @@ -declare substituters trusted_public_keys drv_path - +declare drv_path host="root@fedi203.abundos.eu" - sshOpts=( -o BatchMode=yes -o StrictHostKeyChecking=no ) - command=(nix-instantiate --expr ' let sources = import ./npins; @@ -33,27 +30,13 @@ command=(nix-instantiate --expr ' }; in { - substituters = builtins.concatStringsSep " " os.config.nix.settings.substituters; - trusted_public_keys = builtins.concatStringsSep " " os.config.nix.settings.trusted-public-keys; drv_path = os.config.system.build.toplevel.drvPath; out_path = os.config.system.build.toplevel; } ') - -buildArgs=( - --option extra-binary-caches https://cache.nixos.org/ - --option substituters "$substituters" - --option trusted-public-keys "$trusted_public_keys" -) - "${command[@]}" -A out_path - json="$("${command[@]}" --eval --strict --json)" - eval "export $(echo $json | jq -r 'to_entries | map("\(.key)=\(.value)") | @sh')" - -outPath=$(nix-store --realize "$drv_path" "${buildArgs[@]}") - +outPath=$(nix-store --realize "$drv_path") NIX_SSHOPTS="${sshOpts[*]}" nix-copy-closure --to "$host" "$outPath" --gzip --use-substitutes - ssh "${sshOpts[@]}" "$host" "nix-env --profile /nix/var/nix/profiles/system --set $outPath; $outPath/bin/switch-to-configuration switch"