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

Set NIX_FIRST_BUILD_UID to 30001 on macOS #11095

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion scripts/install-darwin-multi-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ set -eu
set -o pipefail

# System specific settings
export NIX_FIRST_BUILD_UID="${NIX_FIRST_BUILD_UID:-30001}"
if [[ $(sw_vers -productVersion | cut -d '.' -f 1) -ge 15 ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, this is a very brittle check -- macOS sometimes decides to lie about the version for "compatibility". If this approach is accepted, you'll need to set SYSTEM_VERSION_COMPAT=0 in this invocation (see e.g. https://eclecticlight.co/2020/08/13/macos-version-numbering-isnt-so-simple/) to ensure you're getting the actual version and not the compatibility version.

export NIX_FIRST_BUILD_UID=${NIX_FIRST_BUILD_UID:-30001}
else
export NIX_FIRST_BUILD_UID=${NIX_FIRST_BUILD_UID:-301}
fi
export NIX_BUILD_USER_NAME_TEMPLATE="_nixbld%d"

readonly NIX_DAEMON_DEST=/Library/LaunchDaemons/org.nixos.nix-daemon.plist
Expand Down