summaryrefslogtreecommitdiff
path: root/system-profiles/rebuild-machines/rebuild-machine.zsh
blob: c06ef0e4daf45bcd3d2445bf98eaa24ba1f60738 (plain)
1
2
3
4
5
6
7
8
9
10
#!@zsh@/bin/zsh -e

if [[ $(@coreutils@/bin/whoami) != "root" ]]; then
    exec @wrapperDir@/sudo -H -- @out@/bin/@scriptName@ $@
fi

export NIX_SSHOPTS="-F @sshConfig@"
export GIT_SSH_COMMAND="@openssh@/bin/ssh -F @sshConfig@"
export GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0="init.defaultBranch" GIT_CONFIG_VALUE_0=main
exec -- @nixosRebuild@/bin/nixos-rebuild --refresh --flake '@flake@' ${@:-switch}