nixpkgs/pkgs/os-specific
r-vdp 76d4d46b0c
nixos-rebuild: set SSHOPTS earlier so that we resolve the correct hostname
Before, when using things like proxy jumps, we would end up with the hostname of either localhost or the jump host (depending on whether you configure the jumphost in your ssh config file or in the SSHOPTS) instead of the hostname of the target host.

I was running the following command:
```bash
NIX_SSHOPTS='-p 6016 -J username@jumphost' nixos-rebuild --verbose --flake '.#' --target-host localhost --use-remote-sudo --fast build
```

and what was getting built was `nixosConfigurations.<localhost hostname>` instead of `nixosConfigurations.<remote hostname>`, because the SSH connection to determine the hostname didn't have the NIX_SSHOPTS added to it yet.

So I simply moved the logic to set up the tmp dir and set the SSHOPTS a bit higher up.
2024-11-12 16:23:37 +00:00
..
bsd treewide: migrate packages to pkgs/by-name, take 1 2024-11-09 20:04:51 +08:00
darwin darwin.libffi: init at 35 (#354108) 2024-11-11 09:43:28 -05:00
linux nixos-rebuild: set SSHOPTS earlier so that we resolve the correct hostname 2024-11-12 16:23:37 +00:00
windows windows.mingw_w64: fix building on arm 2024-11-06 17:27:15 -05:00