Skip to content

Commit

Permalink
Document how to set up build users on Mac OS X
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Jan 6, 2015
1 parent df05f49 commit 4d5c9d8
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions doc/manual/installation/multi-user.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,34 @@ This creates 10 build users. There can never be more concurrent builds
than the number of build users, so you may want to increase this if
you expect to do many builds at the same time.</para>

<para>On Mac OS X, you can create the required group and users by
running the following script:

<programlisting>
#! /bin/bash -e

dseditgroup -o create nixbld -q

gid=$(dscl . -read /Groups/nixbld | awk '($1 == "PrimaryGroupID:") {print $2 }')

echo "created nixbld group with gid $gid"

for i in $(seq 1 10); do
user=/Users/nixbld$i
uid="$((30000 + $i))"
dscl . create $user
dscl . create $user RealName "Nix build user $i"
dscl . create $user PrimaryGroupID "$gid"
dscl . create $user UserShell /usr/bin/false
dscl . create $user NFSHomeDirectory /var/empty
dscl . create $user UniqueID "$uid"
dseditgroup -o edit -a nixbld$i -t user nixbld
echo "created nixbld$i user with uid $uid"
done
</programlisting>

</para>

</simplesect>


Expand Down

0 comments on commit 4d5c9d8

Please sign in to comment.