Skip to content

Commit b53b07b

Browse files
authored
Merge pull request #11421 from NixOS/mergify/bp/2.24-maintenance/pr-10919
install-darwin: fix _nixbld uids for macOS sequoia (backport #10919)
2 parents ea7abb5 + 8d0414d commit b53b07b

4 files changed

Lines changed: 15 additions & 6 deletions

File tree

scripts/bigsur-nixbld-user-migration.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
((NEW_NIX_FIRST_BUILD_UID=301))
3+
((NEW_NIX_FIRST_BUILD_UID=351))
44

55
id_available(){
66
dscl . list /Users UniqueID | grep -E '\b'"$1"'\b' >/dev/null

scripts/install-darwin-multi-user.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@ set -eu
44
set -o pipefail
55

66
# System specific settings
7-
export NIX_FIRST_BUILD_UID="${NIX_FIRST_BUILD_UID:-301}"
7+
# Notes:
8+
# - up to macOS Big Sur we used the same GID/UIDs as Linux (30000:30001-32)
9+
# - we changed UID to 301 because Big Sur updates failed into recovery mode
10+
# we're targeting the 200-400 UID range for role users mentioned in the
11+
# usage note for sysadminctl
12+
# - we changed UID to 351 because Sequoia now uses UIDs 300-304 for its own
13+
# daemon users
14+
# - we changed GID to 350 alongside above just because it hides the nixbld
15+
# group from the Users & Groups settings panel :)
16+
export NIX_FIRST_BUILD_UID="${NIX_FIRST_BUILD_UID:-351}"
17+
export NIX_BUILD_GROUP_ID="${NIX_BUILD_GROUP_ID:-350}"
818
export NIX_BUILD_USER_NAME_TEMPLATE="_nixbld%d"
919

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

scripts/install-multi-user.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ readonly RED='\033[31m'
2323
# installer allows overriding build user count to speed up installation
2424
# as creating each user takes non-trivial amount of time on macos
2525
readonly NIX_USER_COUNT=${NIX_USER_COUNT:-32}
26-
readonly NIX_BUILD_GROUP_ID="${NIX_BUILD_GROUP_ID:-30000}"
2726
readonly NIX_BUILD_GROUP_NAME="nixbld"
2827
# each system specific installer must set these:
2928
# NIX_FIRST_BUILD_UID
29+
# NIX_BUILD_GROUP_ID
3030
# NIX_BUILD_USER_NAME_TEMPLATE
3131
# Please don't change this. We don't support it, because the
3232
# default shell profile that comes with Nix doesn't support it.
@@ -530,9 +530,7 @@ It seems the build group $NIX_BUILD_GROUP_NAME already exists, but
530530
with the UID $primary_group_id. This script can't really handle
531531
that right now, so I'm going to give up.
532532
533-
You can fix this by editing this script and changing the
534-
NIX_BUILD_GROUP_ID variable near the top to from $NIX_BUILD_GROUP_ID
535-
to $primary_group_id and re-run.
533+
You can export NIX_BUILD_GROUP_ID=$primary_group_id and re-run.
536534
EOF
537535
else
538536
row " Exists" "Yes"

scripts/install-systemd-multi-user.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -o pipefail
55

66
# System specific settings
77
export NIX_FIRST_BUILD_UID="${NIX_FIRST_BUILD_UID:-30001}"
8+
export NIX_BUILD_GROUP_ID="${NIX_BUILD_GROUP_ID:-30000}"
89
export NIX_BUILD_USER_NAME_TEMPLATE="nixbld%d"
910

1011
readonly SERVICE_SRC=/lib/systemd/system/nix-daemon.service

0 commit comments

Comments
 (0)