Skip to content

Make normal ID allocation range configurable (normalIdRange) - #61

Open
Mic92 wants to merge 1 commit into
nikstur:mainfrom
Mic92:normal-id-range
Open

Make normal ID allocation range configurable (normalIdRange)#61
Mic92 wants to merge 1 commit into
nikstur:mainfrom
Mic92:normal-id-range

Conversation

@Mic92

@Mic92 Mic92 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Stacked on #60.

Adds a top-level normalIdRange config field (default 1000-29999) controlling the range for dynamically allocated normal user/group IDs, so statically assigned IDs (e.g. for NFS) can be kept outside of it. System IDs stay at 1-999.

@Mic92

Mic92 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

This helps when people add static uids after the fact since it gives a save range that won't be used by userborn ever.

Systems that rely on statically assigned UIDs/GIDs (e.g. for NFS) need
dynamic allocation to stay out of the range used for those static IDs.
Add a top-level normalIdRange field to the config (default 1000-29999)
that controls the range from which normal user/group IDs are
dynamically allocated. System IDs remain fixed at 1-999.

@nikstur nikstur left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks! This generally makes sense but it cannot be wired up in Nixpkgs right now because there is no option for it.

Comment thread rust/userborn/src/id.rs
/// The range from which normal user/group IDs are dynamically allocated.
#[derive(Deserialize, Debug, Clone, Copy)]
#[serde(rename_all = "camelCase")]
pub struct IdRange {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This type and its impl belong in the config module.

pub struct Config {
/// The range from which normal user/group IDs are dynamically allocated.
#[serde(default)]
pub normal_id_range: IdRange,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

What would be the option to set this in Nixpkgs?

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