Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A few days ago, there was a change [^1] that removed the `nix.configureBuildUsers` option, and made it so that the build users and group was always managed. Unfortunately this broke the `auto-allocate-uids` option: 1. `configureBuildUsers` (internal variable) is set to false if `auto-allocate-uids` is set to true. (Line 15) 2. The users and groups are configured when `configureBuildUsers` is true (so `auto-allocate-uids` is false)... (Line 841) 3. ...but the users and groups are added to `knownUsers` and `knownGroups` regardless... (Line 846) 4. ...which leads to the assertions on Line 798 always being false, and also leads to nix-darwin attempt to delete the `nixbld` group. The error shown when rebuilding with the problematic change and `auto-allocate-uids` enabled is this: ``` error: Failed assertions: - refusing to delete group nixbld in users.knownGroups, this would break nix - refusing to delete user _nixbld1 in users.knownUsers, this would break nix ``` This PR fixes both of these issues (failed assertion and attempt to delete `nixbld` group, which is still necessary for `auto-allocate-uids` despite no users being in the group), by only adding the user assertions when `configureBuildUsers` is true, and updating the `users.knownUsers` to also only be set in that case. Additionally, the `nixbld` group is now always created. [^1]: Commit adc989f
- Loading branch information