From 32b49ad6c55b588d5e5ea8aebba5ddb1c36bd96f Mon Sep 17 00:00:00 2001 From: cnst Date: Sun, 20 Jul 2025 10:02:35 +0200 Subject: [PATCH] server variables --- modules/server/default.nix | 40 +++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/modules/server/default.nix b/modules/server/default.nix index cf64bea1..707957f6 100644 --- a/modules/server/default.nix +++ b/modules/server/default.nix @@ -1,5 +1,10 @@ -{lib, ...}: let +{ + lib, + config, + ... +}: let inherit (lib) mkOption types; + cfg = config.server; in { options.server = { email = mkOption { @@ -16,5 +21,38 @@ in { Domain name to be used to access the server services via Caddy reverse proxy ''; }; + user = lib.mkOption { + default = "share"; + type = lib.types.str; + description = '' + User to run the homelab services as + ''; + }; + group = lib.mkOption { + default = "share"; + type = lib.types.str; + description = '' + Group to run the homelab services as + ''; + }; + timeZone = lib.mkOption { + default = "Europe/Stockholm"; + type = lib.types.str; + description = '' + Time zone to be used for the homelab services + ''; + }; + }; + config = lib.mkIf cfg.enable { + users = { + groups.${cfg.group} = { + gid = 993; + }; + users.${cfg.user} = { + uid = 994; + isSystemUser = true; + group = cfg.group; + }; + }; }; }