(address . bug-guix@gnu.org)
The commands in https://guix.gnu.org/manual/en/guix.html#Build-Environment-Setup
do not work on busybox-based systems such as Alpine Linux by default.
This is because they do not have 'groupadd' or 'useradd' by default (from 'shadow' package).
# groupadd --system guixbuild
# for i in `seq -w 1 10`;
do
useradd -g guixbuild -G guixbuild \
-d /var/empty -s `which nologin` \
-c "Guix build user $i" --system \
guixbuilder$i;
done
I suggest adding another example which works by default on busybox.
Explanation: -S means 'add system group/user'; -h is 'home directory'; -g is 'GECOS field'
Also, Alpine Linux fails to boot if /var/empty is not owned by root, so that needs to be fixed afterward as well.
addgroup -S guixbuild
for i in `seq -w 1 10`;
do
adduser -G guixbuild \
-h /var/empty -s `which nologin` \
-g "Guix build user $i" -S \
guixbuilder$i;
done
chown root:root /var/empty # /var/empty must be owned by root, fix permission after `adduser` modified it