Merge pull request #150975 from NixOS/revert-150065-workaround-issue-144811

Revert "nixos-rebuild: switch to tmpDir during rebuilds"
This commit is contained in:
Maximilian Bosch 2021-12-16 23:15:04 +01:00 committed by GitHub
commit fb0091f094
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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