I need to refer to another user’s UID and GID in a user configuration. Specifically, I want to replace the startUid
and startGid
values in the below with references to the other user:
users.users = {
root = {
subUidRanges = [
{
startUid = 1001;
count = 65536;
}
];
subGidRanges = [
{
startGid = 100;
count = 65536;
}
];
};
username = {
…
};
};
So instead I want something like this:
users.users = {
root = {
subUidRanges = [
{
startUid = username.uid;
count = 65536;
}
];
subGidRanges = [
{
startGid = username.mainGroup.gid;
count = 65536;
}
];
};
username = {
…
};
};
However, username.uid
(or users.users.username.uid
) is not found, and I can’t find any way to get the GID of the main group of a user. I guess something like users.groups.${users.users.username.group}.gid
, but I don’t know the syntax and it would run into the same problem as before.