summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2018-11-27 00:58:07 +0100
committerlassulus <lassulus@lassul.us>2018-11-27 00:58:07 +0100
commit09ee7ca4d832bfdc836c9463513891f1e97db10b (patch)
treeb27affdbe7a83c9841f8cfd3077a95973ae660c8
parentc35bc044dba5260bea5574a86897c6c45b4e525a (diff)
ci: add gcroot for build-scripts
-rw-r--r--krebs/3modules/ci.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/krebs/3modules/ci.nix b/krebs/3modules/ci.nix
index 62efce44b..d8d0e7f3d 100644
--- a/krebs/3modules/ci.nix
+++ b/krebs/3modules/ci.nix
@@ -28,7 +28,13 @@ let
getJobs = pkgs.writeDash "get_jobs" ''
set -efu
nix-build --no-out-link --quiet -Q ./ci.nix > /dev/null
- nix-instantiate --quiet -Q --eval --strict --json ./ci.nix
+ js="$(nix-instantiate --quiet -Q --eval --strict --json ./ci.nix)"
+ echo "$js" | jq -r 'to_entries[] | [.key, .value] | @tsv' \
+ | while read -r host builder; do
+ gcroot=${shell.escape profileRoot}/$host-builder
+ ${pkgs.nix}/bin/nix-env -p "$gcroot" --set "$builder"
+ done
+ echo "$js"
'';
profileRoot = "/nix/var/nix/profiles/ci";