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:
parent
273ecdf070
commit
6c30ba3e48
@ -32,8 +32,8 @@ let
|
|||||||
calls in `libstore/build.cc', don't add any supplementary group
|
calls in `libstore/build.cc', don't add any supplementary group
|
||||||
here. */
|
here. */
|
||||||
uid = builtins.add ids.uids.nixbld nr;
|
uid = builtins.add ids.uids.nixbld nr;
|
||||||
group = "nixbld";
|
group = "nogroup";
|
||||||
extraGroups = [];
|
extraGroups = ["nixbld"];
|
||||||
};
|
};
|
||||||
|
|
||||||
nixBuildUsers = map makeNixBuildUser (pkgs.lib.range 1 10);
|
nixBuildUsers = map makeNixBuildUser (pkgs.lib.range 1 10);
|
||||||
@ -213,16 +213,6 @@ in
|
|||||||
--groups "$extraGroups" \
|
--groups "$extraGroups" \
|
||||||
''${home:+--home "$home"} \
|
''${home:+--home "$home"} \
|
||||||
--shell "$shell"
|
--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
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user