From f47b06a7198932dd3ffbebd03cdadbff26a89479 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 26 Nov 2026 16:42:31 +0000 Subject: krops.nix: evaluate with the builder's system --- krops.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'krops.nix') 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 \ '') -- cgit v1.3.1