Skip to content
Closed
Changes from all commits
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:-301}"
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