-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
WIP: installer: allow overriding nix user UID on darwin too #6466
WIP: installer: allow overriding nix user UID on darwin too #6466
Conversation
Similar to f4d57aa ("installer: allow overriding nix user GID and UIDs"), but for darwin. (There's no corresponding *_GID in this script though, so skipping that.) Ref NixOS#6153.
I don't have enough time to look, but I think it may not be this simple. Iirc the variable is already set in the core multiuser script, so I think this would start inheriting that default? |
You're right, landing this PR now would mean effectively changing the darwin default UID from 301 to 30001. |
@@ -6,7 +6,7 @@ set -o pipefail | |||
readonly NIX_DAEMON_DEST=/Library/LaunchDaemons/org.nixos.nix-daemon.plist | |||
# create by default; set 0 to DIY, use a symlink, etc. | |||
readonly NIX_VOLUME_CREATE=${NIX_VOLUME_CREATE:-1} # now default | |||
NIX_FIRST_BUILD_UID="301" | |||
NIX_FIRST_BUILD_UID="${NIX_FIRST_BUILD_UID:-301}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use a different var name to avoid it being overridden by the parent script.
NIX_FIRST_BUILD_UID="${NIX_FIRST_BUILD_UID:-301}" | |
NIX_FIRST_BUILD_UID="${NIX_FIRST_BUILD_UID_DARWIN:-301}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While it is the simpler change, I think the potential-confusion would be lower if we moved the value-setting out into the ~speciated scripts (i.e., require the platform install scripts to be opinionated on this UID instead of having a default-that-isn't-a-default?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you mean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like:
- replace the default declaration up in the main multiuser script with a comment that says that the speciated ~variant (
-darwin-
,-linux-
) scripts are responsible for setting it - move the default declaration out into the
-linux-
script - do roughly what this current PR does for the
-darwin-
script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotcha. yeah, sounds good.
I'd really like to get some version of this in. It's been causing me headaches. |
@bacchanalia: if you can, please make a PR. |
@bjornfor sure. I just wasn't sure if you were interested in reviving this one or not. |
because there are often already users in the 300 range and it's painful to work around. revives NixOS#6466
Superseded by #9639. |
Similar to f4d57aa ("installer: allow overriding nix user GID and
UIDs"), but for darwin.
(There's no corresponding *_GID in this script though, so skipping
that.)
Ref #6153.