Skip to content

Commit

Permalink
nixos-rebuild: run systemd-run with / as the working directory
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
r-vdp authored and Mic92 committed Nov 2, 2024
1 parent eed2f44 commit cc0617f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ elif [[ "$action" = switch || "$action" = boot || "$action" = test || "$action"
"--no-ask-password"
"--pipe"
"--quiet"
"--same-dir"
"--working-directory=/"
"--service-type=exec"
"--unit=nixos-rebuild-switch-to-configuration"
"--wait"
Expand Down

0 comments on commit cc0617f

Please sign in to comment.