Before we would run systemd-run with the user's home dir as the working
directory, but this causes issues when the home dir is on a separate
partition and that partition cannot be mounted, as the transient unit
created by systemd-run would gain a dependency on the home mount and fail.
Since the root partition is guaranteed to be mounted, using that as the
working directory avoids this issue and allows doing a remote
nixos-rebuild to fix the issue preventing /home from being mounted.
Reverts #344407
This has broken nixos-rebuild switch so that it no longer updates the profile, which has bad consequences including not updating the systemd-boot menu with new generations.
`pkgs.zfs_unstable` is pre-release software and may very well have
critical bugs that make it unsuitable for general use. As such, we
should not recommend it as a general solution to the problem of "my
Kernel is too new for stable ZFS".
- In some cases, move into a conditional as the substitution is only
needed on some version
- One use of `--replace-warn` since it is looking in a set of files
where the exact files that might contain it may change over time, but
we want to cover all of them
By executing the whole switching process using one script, we avoid
some ssh roundtrips that would slow down deployment swith --target-host.
For the other benefits, see https://github.com/NixOS/nixpkgs/issues/266290
SSH merges its arguments by space-concatenation - it does not preserve
the array structure.
This is arguably a historic mistake, whose fix would be too breaking.
I suppose it will stay this way forever, until perhaps a better behavior
can be opted in to using a flag, and I don't think this flag exists yet.
To make multi-argument commands work reliably over ssh, we need to escape
them, which is what the ${@@Q} incantation achieves.