cleanup nas I think or something
This commit is contained in:
@@ -10,8 +10,6 @@ let
|
||||
inherit (lib.mjallen) mkOpt mkBoolOpt;
|
||||
cfg = config.${namespace}.user;
|
||||
|
||||
isRoot = (cfg.name == "root");
|
||||
|
||||
# Common SSH keys used across systems
|
||||
commonSshKeys = [
|
||||
# MacBook
|
||||
@@ -42,7 +40,11 @@ in
|
||||
|
||||
enableCommonSshKeys = mkBoolOpt true "Whether to include common SSH keys used across systems.";
|
||||
|
||||
uid = mkOpt int (if isRoot then ids.uids.root else 1000) "The user ID for the user account.";
|
||||
uid = mkOpt int 1000 "The user ID for the user account.";
|
||||
|
||||
group = mkOpt str "wheel" "Group of the user";
|
||||
|
||||
gid = mkOpt int 1000 "gid of the group";
|
||||
|
||||
packages = mkOpt (listOf package) [ ] "List of packages to install for this user.";
|
||||
|
||||
@@ -60,50 +62,55 @@ in
|
||||
};
|
||||
|
||||
config = {
|
||||
users.mutableUsers = cfg.mutableUsers;
|
||||
users = {
|
||||
mutableUsers = cfg.mutableUsers;
|
||||
groups.${cfg.group}.gid = lib.mkForce cfg.gid;
|
||||
users.${cfg.name} = {
|
||||
inherit (cfg)
|
||||
name
|
||||
uid
|
||||
linger
|
||||
packages
|
||||
password
|
||||
hashedPassword
|
||||
hashedPasswordFile
|
||||
;
|
||||
|
||||
users.users.${cfg.name} = {
|
||||
inherit (cfg)
|
||||
name
|
||||
uid
|
||||
linger
|
||||
packages
|
||||
password
|
||||
hashedPassword
|
||||
hashedPasswordFile
|
||||
;
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"keys"
|
||||
"networkmanager"
|
||||
"ratbagd"
|
||||
"scanner"
|
||||
"systemd-journal"
|
||||
"mpd"
|
||||
"audio"
|
||||
"video"
|
||||
"input"
|
||||
"plugdev"
|
||||
"lp"
|
||||
"tss"
|
||||
"power"
|
||||
"nix"
|
||||
"i2c"
|
||||
"media"
|
||||
"nscd"
|
||||
"avahi"
|
||||
"podman"
|
||||
"libvirtd"
|
||||
]
|
||||
++ cfg.extraGroups;
|
||||
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"keys"
|
||||
"networkmanager"
|
||||
"ratbagd"
|
||||
"scanner"
|
||||
"systemd-journal"
|
||||
"mpd"
|
||||
"audio"
|
||||
"video"
|
||||
"input"
|
||||
"plugdev"
|
||||
"lp"
|
||||
"tss"
|
||||
"power"
|
||||
"nix"
|
||||
"i2c"
|
||||
]
|
||||
++ cfg.extraGroups;
|
||||
|
||||
group = "users";
|
||||
home = "/home/${cfg.name}";
|
||||
isNormalUser = (!isRoot);
|
||||
isSystemUser = isRoot;
|
||||
shell = lib.mkForce pkgs.zsh;
|
||||
|
||||
# SSH keys - combine user-specific and common keys
|
||||
openssh.authorizedKeys.keys = cfg.sshKeys ++ (lib.optionals cfg.enableCommonSshKeys commonSshKeys);
|
||||
}
|
||||
// cfg.extraOptions;
|
||||
group = cfg.group;
|
||||
home = "/home/${cfg.name}";
|
||||
isNormalUser = true;
|
||||
shell = lib.mkForce pkgs.zsh;
|
||||
|
||||
# SSH keys - combine user-specific and common keys
|
||||
openssh.authorizedKeys.keys = cfg.sshKeys ++ (lib.optionals cfg.enableCommonSshKeys commonSshKeys);
|
||||
}
|
||||
// cfg.extraOptions;
|
||||
};
|
||||
assertions = [
|
||||
{
|
||||
assertion =
|
||||
|
||||
Reference in New Issue
Block a user