fix nix-build trouble after fresh install:

problem:
Nix only recognizes nixbld users which have nixbld set in extraGroups.
After installation the user was created by activate with group='nixbld'
and extraGroups=[]
After rebooting a conditional shell script fixed this by adding
extraGroups=["nixbld"].

This patches creates the user they way it was in the past with
group='nobody' and extraGroups=["nixbld"].

Another solution would be making nix be aware of the primary group as
well. However this would require everyone to update Nix after updating
NixOS.

svn path=/nixos/trunk/; revision=18985
This commit is contained in:
Marc Weber 2009-12-16 04:55:31 +00:00
parent 273ecdf070
commit 6c30ba3e48

View File

@ -32,8 +32,8 @@ let
calls in `libstore/build.cc', don't add any supplementary group
here. */
uid = builtins.add ids.uids.nixbld nr;
group = "nixbld";
extraGroups = [];
group = "nogroup";
extraGroups = ["nixbld"];
};
nixBuildUsers = map makeNixBuildUser (pkgs.lib.range 1 10);
@ -213,16 +213,6 @@ in
--groups "$extraGroups" \
''${home:+--home "$home"} \
--shell "$shell"
if test -z "$extraGroups"
then
# Make sure the user is listed as belonging to its
# primary group when it has no supplementary groups. The
# main reason is to have the `nixbld[0-9]' users be
# listed as `nixbld' members; this allows `nix-store' to
# get the UIDs of all the build users by doing a
# getprnam("nixbld") call.
groupmod "$group" -A "$name"
fi
fi
done