Skip to content

Commit

Permalink
users: use launchctl managername to determine session type
Browse files Browse the repository at this point in the history
Seems like this should be more robust, and it will work even
after the activation script purifies its environment. Apparently
it may treat `tmux` sessions like SSH ones, which may have
something to do with `reattach-to-user-namespace`/`pam_reattach`; see
<ChrisJohnsen/tmux-MacOSX-pasteboard#78 (comment)>.
(My hope is that `pam_reattach` does the right thing here, but I
haven’t tested.)
  • Loading branch information
emilazy committed Feb 5, 2025
1 parent 681ed51 commit 7b050d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/users/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ in
homeDirectory=''${homeDirectory#NFSHomeDirectory: }
if ! dscl . -change /Users/nobody NFSHomeDirectory "$homeDirectory" "$homeDirectory" &> /dev/null; then
if [[ -n "$SSH_CONNECTION" ]]; then
if [[ "$(launchctl managername)" != Aqua ]]; then
printf >&2 '\e[1;31merror: users cannot be %s over SSH without Full Disk Access, aborting activation\e[0m\n' "$2"
printf >&2 'The user %s could not be %s as `darwin-rebuild` was not executed with Full Disk Access over SSH.\n' "$1" "$2"
printf >&2 'You can either:\n'
Expand Down

0 comments on commit 7b050d8

Please sign in to comment.