trofi / nix-guix-gentoo

Gentoo overlay for nix and guix functional package managers.
110 stars 9 forks source link

nixbld users missing from nixbld group in /etc/group causes no members error #21

Closed Stinjul closed 2 years ago

Stinjul commented 2 years ago

Basically because it's the primary group for those users they don't appear in /etc/group, which in turns causes the following error for some reason:

nix-channel --update
error: the build users group 'nixbld' has no members

A quick fix seems to be adding the group twice in the user ebuild like so:

ACCT_USER_GROUPS=( nixbld nixbld )

After which the user gets added to nixbld in /etc/group, and nix-channel --update starts working.

There might be a better way to fix this, but I don't think adding them to the group twice causes any issues.

trofi commented 2 years ago

Oh, yes! We used to do it with:

pkg_setup() {
       enewgroup nixbld
       for i in {1..64}; do
               # we list 'nixbld' twice to
               # both assign a primary group for user
               # and add a user to /etc/group
               enewuser nixbld${i} -1 -1 /var/empty nixbld,nixbld
       done
}

And I completely forgot about it. And users don't seem to be wiped afresh when I migrated from user.eclass.

Will try to reproduce locally by wiping out users entirely. Should also help testing the fix.

trofi commented 2 years ago

Got it:

# nix --extra-experimental-features nix-command --extra-experimental-features flakes build nixpkgs#gcc --rebuild
error: the build users group 'nixbld' has no members

I probably just didn't try to build anything since.

trofi commented 2 years ago

Should be fixed by nix-2.10.3-r1. Please give it a try.

Stinjul commented 2 years ago

Worked perfectly, thanks!