From a0b575809bb4c3ff5cfb6ad0ccbdf3f3b324ed56 Mon Sep 17 00:00:00 2001 From: Andreas Bielawski Date: Sat, 7 Sep 2024 11:54:45 +0200 Subject: [PATCH] fix module --- module.nix | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/module.nix b/module.nix index 85d8399..317823a 100644 --- a/module.nix +++ b/module.nix @@ -4,6 +4,9 @@ with lib; let cfg = config.services.gobot; + defaultUser = "gobot"; + + inherit (lib) optionalAttrs; in { options.services.gobot = { @@ -118,13 +121,16 @@ in ]; }; - }; + users = optionalAttrs (cfg.user == defaultUser) { + users.${defaultUser} = { + isSystemUser = true; + group = defaultUser; + description = "Gobot Telegram bot user"; + }; + + groups.${defaultUser} = { }; + }; - users.users.gobot = { - isSystemUser = true; - group = "gobot"; - description = "Gobot Telegram bot user"; }; - users.groups.gobot = { }; }