blob: 3da6a0eaacd4aba51977da1d1fe27525cc2a2d3a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#! /bin/sh -
set -eu
if [ -z "$1" ] || ! expr -- "$1" : "[0-9][0-9]*" >/dev/null; then
echo "Usage: $0 NUMBER" 2>/dev/null
exit 1
fi
if [ "$1" -lt 1 ]; then
echo "ERROR: NUMBER should be at least 1" 2>/dev/null
exit 1
fi
for n in $(seq 1 "$1"); do
user="nixbld${n}"
if pw usershow "$user" >/dev/null 2>&1; then
continue
fi
pw useradd "$user" -c "Nix build user $n" -d /var/empty -G nixbld \
-g nixbld -s /usr/sbin/nologin
done
|