From bff6acc5b58eec5265182dce7b905d5a5b98976a Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 6 Jun 2021 21:25:39 +0200 Subject: rebuild-machines: major cleanup --- system-profiles/rebuild-machines/rebuild-machine.zsh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'system-profiles/rebuild-machines/rebuild-machine.zsh') diff --git a/system-profiles/rebuild-machines/rebuild-machine.zsh b/system-profiles/rebuild-machines/rebuild-machine.zsh index 59df8999..e9e1655f 100644 --- a/system-profiles/rebuild-machines/rebuild-machine.zsh +++ b/system-profiles/rebuild-machines/rebuild-machine.zsh @@ -1,7 +1,8 @@ #!@zsh@/bin/zsh -e -if [[ $(whoami) != "root" ]]; then - exec sudo -H -- $0 $@ +if [[ $(@coreutils@/bin/whoami) != "root" ]]; then + exec @wrapperDir@/sudo -H -- @out@/bin/@scriptName@ $@ fi -exec -- nixos-rebuild --refresh --flake 'git+ssh://machines/nixos?ref=flakes#@hostName@' ${@:-switch} +export NIX_SSHOPTS="-F @sshConfig@" GIT_SSH_COMMAND="@openssh@/bin/ssh -F @sshConfig@" +exec -- @nixosRebuild@/bin/nixos-rebuild --refresh --flake '@flake@' ${@:-switch} -- cgit v1.2.3