summaryrefslogtreecommitdiff
path: root/system-profiles/rebuild-machines/rebuild-machine.zsh
blob: e018e7a7feb3b2e583d06e8fe69591cdb3c55421 (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@#@flakeOutput@' ${@:-switch}