1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 19:51:17 +00:00

make-tarball.nix: Fix running as root

Since Nix now runs builds in a user namespace with uid == 0, this
triggered the message

  warning: the group ‘nixbld’ specified in ‘build-users-group’ does not exist

which make-tarball.nix turns into a fatal error. So clear
build-users-group.

http://hydra.nixos.org/build/44817408
This commit is contained in:
Eelco Dolstra 2016-12-15 13:06:05 +01:00
parent 705829b29a
commit 7a586794d4
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -35,6 +35,7 @@ releaseTools.sourceTarball rec {
export NIX_DB_DIR=$TMPDIR
export NIX_STATE_DIR=$TMPDIR
export NIX_PATH=nixpkgs=$TMPDIR/barf.nix
opts=(--option build-users-group "")
nix-store --init
echo 'abort "Illegal use of <nixpkgs> in Nixpkgs."' > $TMPDIR/barf.nix
@ -68,7 +69,8 @@ releaseTools.sourceTarball rec {
nix-env -f . \
--show-trace --argstr system "$platform" \
-qa --drv-path --system-filter \* --system 2>&1 >/dev/null | tee eval-warnings.log
-qa --drv-path --system-filter \* --system \
"''${opts[@]}" 2>&1 >/dev/null | tee eval-warnings.log
if [ -s eval-warnings.log ]; then
echo "Nixpkgs on $platform evaluated with warnings, aborting"
@ -78,7 +80,8 @@ releaseTools.sourceTarball rec {
nix-env -f . \
--show-trace --argstr system "$platform" \
-qa --drv-path --system-filter \* --system --meta --xml > /dev/null
-qa --drv-path --system-filter \* --system --meta --xml \
"''${opts[@]}" > /dev/null
stopNest
done