nibylandia/.ci.sh
Ari Gato 0320d68273 treewide: rework CI, allow skipping some hosts
some of the hosts aren't actually deployed that often, while building
their configuration is long (eg. kernel rebuilds).
2024-07-29 15:00:01 +02:00

27 lines
595 B
Bash
Executable file

#!/usr/bin/env bash
set -a
source /run/agenix/ci-secrets
set +a
cat ci-secrets.nix | envsubst > ci-secrets.nix.tmp
mv ci-secrets.nix.tmp ci-secrets.nix
set -eou pipefail
set -x
while read hostOutput; do
echo "${hostOutput}"
nixos-rebuild build --verbose --flake ".#${hostOutput}"
done < <(nix eval --raw --impure --expr '
let
hosts = (import ./meta.nix).hosts;
filterHosts = hosts: (
builtins.filter (h: !hosts.${h}.ciSkip && hosts.${h}.system == builtins.currentSystem)
(builtins.attrNames hosts)
);
in
builtins.concatStringsSep "\n" (filterHosts hosts)
'; echo ""
)