From 6c30ba3e483ab7d0b471b296aec9db2ccda8a1d1 Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Wed, 16 Dec 2009 04:55:31 +0000 Subject: [PATCH] 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 --- modules/config/users-groups.nix | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/modules/config/users-groups.nix b/modules/config/users-groups.nix index 38b11784c6d..552764b3aea 100644 --- a/modules/config/users-groups.nix +++ b/modules/config/users-groups.nix @@ -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