nixos/scripts/test-config.sh

16 lines
349 B
Bash
Raw Normal View History

#!/bin/bash
for host in $(all-hosts); do
printf -- "-> Checking %s.. " "$host"
2022-05-11 11:26:01 +02:00
if nixos-rebuild --show-trace --flake ".#$host" dry-build 2>/tmp/build-output; then
printf "ok\n"
else
printf "failed!\n"
bat --file-name "Failed to verify config for $host" /tmp/build-output
exit 1
fi
done
printf -- "--> All checks passed\n"