Add givenName & surname

This commit is contained in:
niten 2023-09-06 17:37:55 -07:00
parent cea913f1fe
commit dbf6cd6337
1 changed files with 85 additions and 74 deletions

View File

@ -1,7 +1,6 @@
{ lib, ... }: { lib, ... }:
with lib; with lib; rec {
rec {
systemUserOpts = { name, ... }: { systemUserOpts = { name, ... }: {
options = with lib.types; { options = with lib.types; {
username = mkOption { username = mkOption {
@ -23,93 +22,105 @@ rec {
}; };
}; };
userOpts = { name, ... }: let userOpts = { name, ... }:
username = name; let username = name;
in { in {
options = with lib.types; { options = with lib.types; {
username = mkOption { username = mkOption {
type = str; type = str;
description = "The user's login name."; description = "The user's login name.";
default = username; default = username;
}; };
uid = mkOption { uid = mkOption {
type = int; type = int;
description = "Unique UID number for the user."; description = "Unique UID number for the user.";
}; };
common-name = mkOption { common-name = mkOption {
type = str; type = str;
description = "The user's common or given name."; description = "The user's common or given name.";
}; };
primary-group = mkOption { primary-group = mkOption {
type = str; type = str;
description = "Primary group to which the user belongs."; description = "Primary group to which the user belongs.";
}; };
login-shell = mkOption { login-shell = mkOption {
type = nullOr shellPackage; type = nullOr shellPackage;
description = "The user's preferred shell."; description = "The user's preferred shell.";
}; };
description = mkOption { description = mkOption {
type = str; type = str;
default = "Fudo Member"; default = "Fudo Member";
description = "A description of this user's role."; description = "A description of this user's role.";
}; };
ldap-hashed-passwd = mkOption { ldap-hashed-passwd = mkOption {
type = nullOr str; type = nullOr str;
description = description =
"LDAP-formatted hashed password, used for email and other services. Use slappasswd to generate the properly-formatted password."; "LDAP-formatted hashed password, used for email and other services. Use slappasswd to generate the properly-formatted password.";
default = null; default = null;
}; };
login-hashed-passwd = mkOption { login-hashed-passwd = mkOption {
type = nullOr str; type = nullOr str;
description = description =
"Hashed password for shell, used for shell access to hosts. Use mkpasswd to generate the properly-formatted password."; "Hashed password for shell, used for shell access to hosts. Use mkpasswd to generate the properly-formatted password.";
default = null; default = null;
}; };
ssh-authorized-keys = mkOption { ssh-authorized-keys = mkOption {
type = listOf str; type = listOf str;
description = "SSH public keys this user can use to log in."; description = "SSH public keys this user can use to log in.";
default = [ ]; default = [ ];
}; };
home-directory = mkOption { home-directory = mkOption {
type = nullOr str; type = nullOr str;
description = "Default home directory for the given user."; description = "Default home directory for the given user.";
default = null; default = null;
}; };
k5login = mkOption { k5login = mkOption {
type = listOf str; type = listOf str;
description = "List of Kerberos principals that map to this user."; description = "List of Kerberos principals that map to this user.";
default = [ ]; default = [ ];
}; };
ssh-keys = mkOption { ssh-keys = mkOption {
type = listOf (submodule sshKeyOpts); type = listOf (submodule sshKeyOpts);
description = "Path to the user's public and private key files."; description = "Path to the user's public and private key files.";
default = []; default = [ ];
}; };
email = mkOption { email = mkOption {
type = nullOr str; type = nullOr str;
description = "User's primary email address."; description = "User's primary email address.";
default = null; default = null;
}; };
email-aliases = mkOption { email-aliases = mkOption {
type = listOf str; type = listOf str;
description = "Email aliases that should map to this user."; description = "Email aliases that should map to this user.";
default = []; default = [ ];
};
given-name = mkOption {
type = nullOr str;
description = "User's given name.";
default = null;
};
surname = mkOption {
type = nullOr str;
description = "User's surname.";
default = null;
};
}; };
}; };
};
groupOpts = { name, ... }: { groupOpts = { name, ... }: {
options = with lib.types; { options = with lib.types; {