diff options
Diffstat (limited to 'configs')
| -rw-r--r-- | configs/hrm-ci.nix | 24 |
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 + ''; + }; +} |
