summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-26 16:42:31 +0000
committertv <tv@krebsco.de>2026-11-26 16:48:26 +0000
commitf47b06a7198932dd3ffbebd03cdadbff26a89479 (patch)
treea792ea5f246c07acd6b0dd56bd3b3fbf94529294
parent4757548fc4ab2d3eda41a3b233997fc11670d587 (diff)
krops.nix: evaluate with the builder's system
-rw-r--r--krops.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/krops.nix b/krops.nix
index 94dd9326..d5e90b08 100644
--- a/krops.nix
+++ b/krops.nix
@@ -269,9 +269,10 @@ rec {
#
# Choose the first builder that answers, and note its state.
#
- builder_probe='printf "%s %s %s %s\n" "$(cut -d" " -f1 /proc/loadavg)" "$(nproc)" \
+ builder_probe='printf "%s %s %s %s %s\n" "$(cut -d" " -f1 /proc/loadavg)" "$(nproc)" \
"$(awk "/^MemAvailable:/{print \$2*1024}" /proc/meminfo)" \
- "$(df -B1 --output=avail /nix | tail -n 1)"'
+ "$(df -B1 --output=avail /nix | tail -n 1)" \
+ "$(nix-instantiate --eval --json -E builtins.currentSystem | tr -d \")"'
builder=
${lib.concatMapStrings (b: /* sh */ ''
if test -z "$builder"; then
@@ -294,6 +295,7 @@ rec {
fi
set -- $builder_state
builder_load=$1 builder_cpus=$2 builder_mem=$3 builder_disk=$4
+ builder_system=$5
#
# Evaluate here, keeping the derivation for diff.
@@ -302,6 +304,7 @@ rec {
drv=$(nix-instantiate \
--show-trace \
--add-root "$host_cache"/roots/"$name".drv \
+ --argstr buildSystem "$builder_system" \
--argstr secretDirectory ${q "${target'.path}/secrets"} \
--attr nixosConfigurations."$name".config.system.build.toplevel \
'<hrm/legacy.nix>')