#!/bin/sh -eux
cd "${0%/*}"
-chmod -R g-rwx,o-rwx private/root
-trap 'git reset private/root' EXIT
-git rm -rf --cached --ignore-unmatch private/root # prevent copying to /nix/store
-time nix -L build -o hosts/"$1".root .\#nixosConfigurations."$1".config.system.build.toplevel
+host=$1
+shift
+time nix -L build --keep-going "$@" -o hosts/"$host".root .\#nixosConfigurations."$host".config.system.build.toplevel