summaryrefslogtreecommitdiff
path: root/modules/users
diff options
context:
space:
mode:
authorMichael Hoang <enzime@users.noreply.github.com>2024-10-19 16:13:33 +1100
committerMichael Hoang <enzime@users.noreply.github.com>2024-10-22 16:02:21 +1100
commit5b873c48ace1ee08186d88288cf4f565202c0f28 (patch)
tree92f41aad0b3ae306e7b8c85c7b99c9fe3d50e880 /modules/users
parent2788e4fa981566e34fa40938705cd7f595f05e74 (diff)
users: set `default` for `users.users.<user>.name`
Diffstat (limited to 'modules/users')
-rw-r--r--modules/users/group.nix13
-rw-r--r--modules/users/user.nix13
2 files changed, 8 insertions, 18 deletions
diff --git a/modules/users/group.nix b/modules/users/group.nix
index 0e74085..da3feb1 100644
--- a/modules/users/group.nix
+++ b/modules/users/group.nix
@@ -1,11 +1,12 @@
{ name, lib, ... }:
-with lib;
-
{
- options = {
+ options = let
+ inherit (lib) mkOption types;
+ in {
name = mkOption {
type = types.str;
+ default = name;
description = ''
The group's name. If undefined, the name of the attribute set
will be used.
@@ -29,10 +30,4 @@ with lib;
description = "The group's description.";
};
};
-
- config = {
-
- name = mkDefault name;
-
- };
}
diff --git a/modules/users/user.nix b/modules/users/user.nix
index 4e3f1c9..363c300 100644
--- a/modules/users/user.nix
+++ b/modules/users/user.nix
@@ -1,11 +1,12 @@
{ name, lib, ... }:
-with lib;
-
{
- options = {
+ options = let
+ inherit (lib) literalExpression mkOption types;
+ in {
name = mkOption {
type = types.str;
+ default = name;
description = ''
The name of the user account. If undefined, the name of the
attribute set will be used.
@@ -75,10 +76,4 @@ with lib;
'';
};
};
-
- config = {
-
- name = mkDefault name;
-
- };
}