From 5b873c48ace1ee08186d88288cf4f565202c0f28 Mon Sep 17 00:00:00 2001 From: Michael Hoang Date: Sat, 19 Oct 2024 16:13:33 +1100 Subject: [PATCH] users: set `default` for `users.users..name` --- modules/users/group.nix | 13 ++++--------- modules/users/user.nix | 13 ++++--------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/modules/users/group.nix b/modules/users/group.nix index 0e74085d..da3feb1b 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 4e3f1c94..363c3004 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; - - }; }