fix(ci): update system list

This commit is contained in:
arcnmx 2024-03-25 10:53:26 -07:00
parent 32bc421560
commit 0fbd142a16
5 changed files with 96 additions and 17 deletions

View file

@ -11,32 +11,58 @@ NIX_BUILD_ARGS=(
--show-trace
)
for nfsystem in "${NF_NIX_SYSTEMS[@]}"; do
init_nfargs() {
nflinksuffix="$1"
shift
nfargs=(
"${NIX_BUILD_ARGS[@]}"
)
if [[ -n "${NF_ACTIONS_TEST_OUTLINK-}" || -n "${NF_UPDATE_CACHIX_PUSH-}" ]]; then
nfargs+=(
-o "${NF_ACTIONS_TEST_OUTLINK-result}-$nfsystem"
-o "${NF_ACTIONS_TEST_OUTLINK-result}$nflinksuffix"
)
else
nfargs+=(
--no-link
)
fi
}
echo "building ${nfsystem}..." >&2
nix build \
"${NF_CONFIG_ROOT}#nixosConfigurations.${nfsystem}.config.system.build.toplevel" \
"${nfargs[@]}" \
"$@"
if [[ -n "${NF_ACTIONS_TEST_GC-}" ]]; then
if [[ -n "${NF_UPDATE_CACHIX_PUSH-}" ]]; then
cachix push gensokyo-infrastructure "./${NF_ACTIONS_TEST_OUTLINK-result}-$nfsystem"*/
rm -f "./${NF_ACTIONS_TEST_OUTLINK-result}-$nfsystem"*
nfgc() {
if [[ -n ${NF_ACTIONS_TEST_GC-} ]]; then
if [[ -n ${NF_UPDATE_CACHIX_PUSH-} ]]; then
cachix push gensokyo-infrastructure "./${NF_ACTIONS_TEST_OUTLINK-result}$nflinksuffix"*/
rm -f "./${NF_ACTIONS_TEST_OUTLINK-result}$nflinksuffix"*
fi
nix-collect-garbage -d
fi
}
for nfsystem in "${NF_NIX_SYSTEMS[@]}"; do
nfinstallable="${NF_CONFIG_ROOT}#nixosConfigurations.${nfsystem}.config.system.build.toplevel"
init_nfargs "-$nfsystem"
if [[ -n ${NF_ACTIONS_TEST_ASYNC-} ]]; then
NIX_BUILD_ARGS+=("$nfinstallable")
continue
fi
echo "building ${nfsystem}..." >&2
nix build "$nfinstallable" \
"${nfargs[@]}" \
"$@"
nfgc
done
if [[ -n ${NF_ACTIONS_TEST_ASYNC-} ]]; then
init_nfargs ""
nix build \
"${nfargs[@]}" \
"$@"
nfgc
fi

View file

@ -5,6 +5,7 @@
"flake-cron.nix"
];
nixosSystems = [
"ct"
"hakurei"
"reimu"
"aya"

View file

@ -25,9 +25,9 @@ with lib; {
};
jobs = let
enabledHosts = ["hakurei" "reimu" "aya" "tei" "litterbox" "keycloak" "mediabox" "ct"];
inherit ((import ./nix.nix).ci) nixosSystems;
in
mapAttrs' (k: nameValuePair "${k}") (genAttrs enabledHosts (host: {
mapAttrs' (k: nameValuePair "${k}") (genAttrs nixosSystems (host: {
tasks.${host}.inputs = channels.nixfiles.nixosConfigurations.${host}.config.system.build.toplevel;
}));