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