2018-01-13 12:41:08 +00:00
|
|
|
{ name, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
name = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
description = ''
|
|
|
|
The name of the user account. If undefined, the name of the
|
|
|
|
attribute set will be used.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
description = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
default = "";
|
|
|
|
example = "Alice Q. User";
|
|
|
|
description = ''
|
|
|
|
A short description of the user account, typically the
|
|
|
|
user's full name.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
uid = mkOption {
|
|
|
|
type = types.int;
|
|
|
|
description = "The user's UID.";
|
|
|
|
};
|
|
|
|
|
|
|
|
gid = mkOption {
|
|
|
|
type = types.int;
|
|
|
|
default = 20;
|
|
|
|
description = "The user's primary group.";
|
|
|
|
};
|
|
|
|
|
|
|
|
isHidden = mkOption {
|
|
|
|
type = types.bool;
|
2018-01-14 15:15:27 +00:00
|
|
|
default = true;
|
2018-01-13 12:41:08 +00:00
|
|
|
description = "Whether to make the user account hidden.";
|
|
|
|
};
|
|
|
|
|
|
|
|
# extraGroups = mkOption {
|
|
|
|
# type = types.listOf types.str;
|
|
|
|
# default = [];
|
|
|
|
# description = "The user's auxiliary groups.";
|
|
|
|
# };
|
|
|
|
|
|
|
|
home = mkOption {
|
|
|
|
type = types.path;
|
|
|
|
default = "/var/empty";
|
|
|
|
description = "The user's home directory.";
|
|
|
|
};
|
|
|
|
|
2019-02-23 16:29:57 +00:00
|
|
|
createHome = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = "Create the home directory when creating the user.";
|
|
|
|
};
|
|
|
|
|
2018-01-13 12:41:08 +00:00
|
|
|
shell = mkOption {
|
|
|
|
type = types.either types.shellPackage types.path;
|
|
|
|
default = "/sbin/nologin";
|
2021-10-23 13:05:52 +00:00
|
|
|
example = literalExpression "pkgs.bashInteractive";
|
2018-01-13 12:41:08 +00:00
|
|
|
description = "The user's shell.";
|
|
|
|
};
|
2019-02-20 16:20:32 +00:00
|
|
|
|
|
|
|
packages = mkOption {
|
|
|
|
type = types.listOf types.package;
|
|
|
|
default = [];
|
2021-10-23 13:05:52 +00:00
|
|
|
example = literalExpression "[ pkgs.firefox pkgs.thunderbird ]";
|
2019-02-20 16:20:32 +00:00
|
|
|
description = ''
|
|
|
|
The set of packages that should be made availabe to the user.
|
|
|
|
This is in contrast to <option>environment.systemPackages</option>,
|
|
|
|
which adds packages to all users.
|
|
|
|
'';
|
|
|
|
};
|
2018-01-13 12:41:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = {
|
|
|
|
|
|
|
|
name = mkDefault name;
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|