Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -H to sudo nix-env [...] calls in darwin-rebuild.sh to deal with warning #509

Merged
merged 1 commit into from
Aug 30, 2022

Conversation

malob
Copy link
Contributor

@malob malob commented Aug 29, 2022

After NixOS/nix#6676, the following warning is displayed when running darwin-rebuild switch:

warning: $HOME ('/Users/jamie') is not owned by you, falling back to the one defined in the 'passwd' file.

This happens because, on macOS sudo does not set $HOME by default, the -H flag needs to be added for it to do so.

Fixes: #481
Fixes: #477

After NixOS/nix#6676, the following warning is displayed when running
`darwin-rebuild switch`:
  warning: $HOME ('/Users/jamie') is not owned by you, falling back to the
  one defined in the 'passwd' file.
@malob
Copy link
Contributor Author

malob commented Aug 29, 2022

@lilyball, seems to know more about this than I do, so tagging her here in case she has context etc. to add.

@domenkozar domenkozar merged commit db543d3 into LnL7:master Aug 30, 2022
@malob malob deleted the fix-warning-about-HOME branch August 30, 2022 17:57
@lilyball
Copy link
Contributor

It might be nice to add -H to the sudo "$systemConfig/activate" line as well. A quick skim of the activate script doesn't show any references to $HOME but it's still probably a good idea for consistency, especially as someone could write a custom activation script that references this variable or invokes a command that itself consults this variable, and system activation should probably try to avoid any dependency on the initiating user.

@lilyball
Copy link
Contributor

@malob BTW I absolutely love all the recent improvements you've been making here!

@malob
Copy link
Contributor Author

malob commented Aug 31, 2022

It might be nice to add -H to the sudo "$systemConfig/activate" line as well. A quick skim of the activate script doesn't show any references to $HOME but it's still probably a good idea for consistency, especially as someone could write a custom activation script that references this variable or invokes a command that itself consults this variable, and system activation should probably try to avoid any dependency on the initiating user.

@lilyball, I don't feel knowledgeable enough about this at the moment to propose this change myself, but if you do, I think you should totally create a PR to propose the change.

@zowoq
Copy link
Contributor

zowoq commented Sep 25, 2023

It might be nice to add -H to the sudo "$systemConfig/activate" line as well.

Opened a PR for this: #783

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants