#!/bin/sh -eux
cd "${0%/*}"
-chmod -R g-rwx,o-rwx "$PWD/private/root"
+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 .\#nixosConfigurations."$1".config.system.build.toplevel
+time nix -L build -o hosts/"$1".root .\#nixosConfigurations."$1".config.system.build.toplevel