Skip to content

Commit

Permalink
Merge pull request #150975 from NixOS/revert-150065-workaround-issue-…
Browse files Browse the repository at this point in the history
…144811

Revert "nixos-rebuild: switch to tmpDir during rebuilds"
  • Loading branch information
Ma27 authored Dec 16, 2021
2 parents 7acf783 + e6ca3fc commit fb0091f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -362,16 +362,14 @@ if [ "$action" = edit ]; then
exit 1
fi

ORIGIN_PWD="$PWD"

tmpDir=$(mktemp -t -d nixos-rebuild.XXXXXX)
SSHOPTS="$NIX_SSHOPTS -o ControlMaster=auto -o ControlPath=$tmpDir/ssh-%n -o ControlPersist=60"
cd "$tmpDir"

cleanup() {
for ctrl in "$tmpDir"/ssh-*; do
ssh -o ControlPath="$ctrl" -O exit dummyhost 2>/dev/null || true
done
cd "$ORIGIN_PWD"
rm -rf "$tmpDir"
}
trap cleanup EXIT
Expand Down

0 comments on commit fb0091f

Please sign in to comment.