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

feat: repeat per-user config for every user #763

Closed
wants to merge 1 commit into from
Closed

feat: repeat per-user config for every user #763

wants to merge 1 commit into from

Conversation

hraban
Copy link
Contributor

@hraban hraban commented Aug 16, 2023

Setting up the dock, menubar, etc. Should be run for every user, not just for the admin running nix-darwin.

I think there are three types of activation code:

  • system-wide which should be run non-root (e.g. brew)
  • system-wide which should be run root (e.g. networking)
  • user-local

The last option being invoked by the second one, using sudo -u username.

This is very POC, mostly to get others' opinions on it. The idea is to expand that userProfileScript with more options as appropriate.

It seems to work on my machine but I wouldn't be surprised to be missing some edge cases.

What do you think?

This addresses #554.

I have a follow-up PR that expands on this to use chsh to set the user's shell from config.users.users.<name>.shell: hraban/nix-darwin@per-user...hraban:nix-darwin:chsh

@emilazy
Copy link
Member

emilazy commented Aug 16, 2023

Thanks for the PR! I agree this is definitely an area that could use improvement. While this is certainly better than the status quo (although I think the defaults/launchd settings should be scoped under users.users in this case), the activate/activate-user split in general is problematic (see #96) and I think in many cases it's stuff we shouldn't be handling at all or that is best delegated to Home Manager. I'm not sure it's a great idea to change semantics incompatibly here without addressing the problem at the root, at least until we have an idea of the destination we're aiming at.

I have a local branch for the issue I linked that kills off activate-user entirely and mostly just drops user-specific stuff, which gets rid of a bunch of weird quirks and pulls us more in line with NixOS's approach of managing the system rather than being sensitive to the user running activation, but it needs a lot of polish and thinking about backwards compatibility before it could go upstream here. (Retaining some of the functionality under users.users in that scheme would certainly be an option too, though.)

Setting up the dock, menubar, etc. Should be run for every user, not just for
the admin running nix-darwin.
@hraban
Copy link
Contributor Author

hraban commented Nov 23, 2023

I misunderstood how this all worked and found a better way to set the shell in #818 . In combination with the other comments, that makes this PR obsolete.

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

Successfully merging this pull request may close these issues.

2 participants