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 = { }; }