diff options
| author | tv <tv@krebsco.de> | 2026-11-26 16:40:52 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-26 16:48:26 +0000 |
| commit | c9cd202a6215af49248916d091e828450fd8a75f (patch) | |
| tree | 1f6ff5e6827ca01b65a34e5e549ca9c7c9164642 | |
| parent | 34f8572fe46e2d009e38d1f3412d5d520b3aba63 (diff) | |
krops.nix: choose the builder before evaluating
| -rw-r--r-- | krops.nix | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -267,19 +267,6 @@ rec { export NIX_PATH="$eval_dir" # - # Evaluate here, keeping the derivation for diff. - # - echo "$name: evaluating..." >&2 - drv=$(nix-instantiate \ - --show-trace \ - --add-root "$host_cache"/roots/"$name".drv \ - --argstr secretDirectory ${q "${target'.path}/secrets"} \ - --attr nixosConfigurations."$name".config.system.build.toplevel \ - '<hrm/legacy.nix>') - # nix-instantiate prints the GC root, a link to the derivation here. - drv=$(readlink -f -- "$drv") - - # # Choose the first builder that answers, and note its state. # builder_probe='printf "%s %s %s %s\n" "$(cut -d" " -f1 /proc/loadavg)" "$(nproc)" \ @@ -309,6 +296,19 @@ rec { builder_load=$1 builder_cpus=$2 builder_mem=$3 builder_disk=$4 # + # Evaluate here, keeping the derivation for diff. + # + echo "$name: evaluating..." >&2 + drv=$(nix-instantiate \ + --show-trace \ + --add-root "$host_cache"/roots/"$name".drv \ + --argstr secretDirectory ${q "${target'.path}/secrets"} \ + --attr nixosConfigurations."$name".config.system.build.toplevel \ + '<hrm/legacy.nix>') + # nix-instantiate prints the GC root, a link to the derivation here. + drv=$(readlink -f -- "$drv") + + # # Build on the builder, into its store, with a GC root there for as # long as this script runs, so the system stays until it's copied. # |
