mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
fix(ci): update system list
This commit is contained in:
parent
32bc421560
commit
0fbd142a16
5 changed files with 96 additions and 17 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
"flake-cron.nix"
|
||||
];
|
||||
nixosSystems = [
|
||||
"ct"
|
||||
"hakurei"
|
||||
"reimu"
|
||||
"aya"
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue