summaryrefslogtreecommitdiffstats
path: root/krops.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-26 16:40:52 +0000
committertv <tv@krebsco.de>2026-11-26 16:48:26 +0000
commitc9cd202a6215af49248916d091e828450fd8a75f (patch)
tree1f6ff5e6827ca01b65a34e5e549ca9c7c9164642 /krops.nix
parent34f8572fe46e2d009e38d1f3412d5d520b3aba63 (diff)
krops.nix: choose the builder before evaluating
Diffstat (limited to 'krops.nix')
-rw-r--r--krops.nix26
1 files changed, 13 insertions, 13 deletions
diff --git a/krops.nix b/krops.nix
index eafa6c76..94dd9326 100644
--- a/krops.nix
+++ b/krops.nix
@@ -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.
#