server variables

This commit is contained in:
2025-07-20 10:02:35 +02:00
parent e56b1b461e
commit 32b49ad6c5

View File

@@ -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;
};
};
};
}