Skip to content

Commit 066d9d8

Browse files
bors[bot]Mic92
andauthored
Merge #33
33: perform reboot in the background r=Mic92 a=Mic92 Co-authored-by: Jörg Thalheim <joerg@thalheim.io>
2 parents 61a3eaa + 2179012 commit 066d9d8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/nixos-remote.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ abort() {
3636

3737
kexec_url=https://github.com/nix-community/nixos-images/releases/download/nixos-22.11/nixos-kexec-installer-x86_64-linux.tar.gz
3838
enable_debug=""
39-
maybereboot="reboot"
39+
maybereboot="sleep 6 && reboot"
4040

4141
declare -A disk_encryption_keys
4242

@@ -252,5 +252,7 @@ set -efu ${enable_debug}
252252
# needed for installation if initrd-secrets are used
253253
mkdir -m777 -p /mnt/tmp
254254
nixos-install --no-root-passwd --no-channel-copy --system "$nixos_system"
255-
${maybereboot}
255+
# We will reboot in background so we can cleanly finish the script before the hosts go down.
256+
# This makes integration into scripts easier
257+
nohup bash -c '${maybereboot}' >/dev/null &
256258
SSH

0 commit comments

Comments
 (0)