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