Add a script to build and push all machines

This commit is contained in:
Andreas Zweili 2024-04-15 21:39:51 +02:00
parent 9e2e0fbca1
commit f71cff27ed
1 changed files with 24 additions and 0 deletions

24
scripts/build-all-machines Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -e
hosts=($(echo $(nix eval "$DEVENV_ROOT"#nixosConfigurations --apply 'pkgs: builtins.concatStringsSep " " (builtins.attrNames pkgs)') | xargs))
skip=(
"desktop-vm"
"gwyn"
"loki-test"
"mobile"
"test-raspi"
"staubfinger"
)
for host in "${hosts[@]}"; do
if [[ " ${skip[*]} " =~ " ${host} " ]]; then
continue
fi
echo $host
nixos-rebuild build --flake "$DEVENV_ROOT#${host}"
attic push prod "$DEVENV_ROOT"/result
rm -f "$DEVENV_ROOT"/result
echo
echo
done