mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-03-18 15:34:13 +01:00
refactor: Use hyphen(`-`) for variable names & folder names(except Python), replace all unserscore(`_`) with hyphen(`-`).
46 lines
1.1 KiB
Nix
46 lines
1.1 KiB
Nix
{
|
|
myvars,
|
|
config,
|
|
...
|
|
}: {
|
|
# Don't allow mutation of users outside the config.
|
|
users.mutableUsers = false;
|
|
|
|
users.groups = {
|
|
"${myvars.username}" = {};
|
|
docker = {};
|
|
wireshark = {};
|
|
# for android platform tools's udev rules
|
|
adbusers = {};
|
|
dialout = {};
|
|
# for openocd (embedded system development)
|
|
plugdev = {};
|
|
# misc
|
|
uinput = {};
|
|
};
|
|
|
|
users.users."${myvars.username}" = {
|
|
# generated by `mkpasswd -m scrypt`
|
|
# we have to use initialHashedPassword here when using tmpfs for /
|
|
initialHashedPassword = "$7$CU..../....KDvTIXqLTXpmCaoUy2yC9.$145eM358b7Q0sRXgEBvxctd5EAuEEdao57LmZjc05D.";
|
|
home = "/home/${myvars.username}";
|
|
isNormalUser = true;
|
|
extraGroups = [
|
|
myvars.username
|
|
"users"
|
|
"networkmanager"
|
|
"wheel"
|
|
"docker"
|
|
"wireshark"
|
|
"adbusers"
|
|
"libvirtd"
|
|
];
|
|
};
|
|
|
|
# root's ssh key are mainly used for remote deployment
|
|
users.users.root = {
|
|
initialHashedPassword = config.users.users."${myvars.username}".initialHashedPassword;
|
|
openssh.authorizedKeys.keys = config.users.users."${myvars.username}".openssh.authorizedKeys.keys;
|
|
};
|
|
}
|