summaryrefslogtreecommitdiffstats
path: root/configs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-19 22:29:29 +0000
committertv <tv@krebsco.de>2026-11-20 01:24:22 +0100
commit4537f3f741374a75db4f03874a21e23a458079ef (patch)
treea15315579146df4be8ace9baaac77af5fb86200a /configs
parent0bc6887673afafdda35fb3887b14a65d3968790e (diff)
configs hrm-ci: initHEADmaster
Define the hrm.ci instance for hrm, which runs nix-build krops.nix --no-out-link --argstr name HOSTNAME -A build for each host with ci = true in its spec.nix.
Diffstat (limited to 'configs')
-rw-r--r--configs/hrm-ci.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/configs/hrm-ci.nix b/configs/hrm-ci.nix
new file mode 100644
index 0000000..b961262
--- /dev/null
+++ b/configs/hrm-ci.nix
@@ -0,0 +1,24 @@
+# hrm.ci instance for hrm itself: builds every host whose
+# systems/HOSTNAME/spec.nix has `ci = true;`.
+#
+# krops.nix finds everything except hrm through $HOME, so the importing host
+# provides the rest with hrm.ci.instances.hrm.dependencies and .home, e.g.
+# dependencies."sync/src/krops".repo = "/var/lib/git/krops";
+# dependencies."sync/src/stockholm".repo = "/var/lib/git/stockholm";
+{ config, lib, ... }: {
+ hrm.ci.instances.hrm = {
+ repo = lib.mkDefault "${config.krebs.git.dataDir}/hrm";
+ jobs = /* sh */ ''
+ set -efu
+ hosts=$(nix-instantiate --eval --strict --json --expr '
+ builtins.filter
+ (name: (import (./systems + "/''${name}/spec.nix")).ci or false)
+ (builtins.attrNames (builtins.readDir ./systems))
+ ')
+ echo "$hosts" | jq -r '.[]'
+ '';
+ build = /* sh */ ''
+ nix-build krops.nix --no-out-link --argstr name "$1" -A build
+ '';
+ };
+}