Skip to content

use existing GID in sequoia migration script#11433

Merged
tomberek merged 1 commit intoNixOS:masterfrom
abathur:fix_sequoia_migration_gid
Sep 5, 2024
Merged

use existing GID in sequoia migration script#11433
tomberek merged 1 commit intoNixOS:masterfrom
abathur:fix_sequoia_migration_gid

Conversation

@abathur
Copy link
Copy Markdown
Member

@abathur abathur commented Sep 5, 2024

Motivation

I hardcoded the wrong GID (30001 instead of 30000), but it's better to just pick up the GID from the existing group.

cc @tomberek

Context

Priorities and Process

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

I hardcoded the wrong GID (30001 instead of 30000), but it's
better to just pick up the GID from the existing group.
@abathur abathur requested a review from edolstra as a code owner September 5, 2024 02:06
@tomberek
Copy link
Copy Markdown
Contributor

tomberek commented Sep 5, 2024

I believe -create will not change an existing user's Primary GID. It may require a -change call.

@abathur
Copy link
Copy Markdown
Member Author

abathur commented Sep 5, 2024

In this case, the function's just running to re-create the missing _nixbldN users clobbered by the update.

That said, though, we have been tending to use -create (over -change) since we've generally observed it to be ~idempotent as long as we aren't trying to do something like change the UID to one that's already taken:

$ sudo /usr/bin/dscl . -read "/Users/_nixbld1" "PrimaryGroupID"
PrimaryGroupID: 350

$ sudo /usr/bin/dscl . -create "/Users/_nixbld1" "PrimaryGroupID" "351"

$ sudo /usr/bin/dscl . -read "/Users/_nixbld1" "PrimaryGroupID"
PrimaryGroupID: 351

Copy link
Copy Markdown
Contributor

@tomberek tomberek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wrong... this should update the users. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants