This commit is contained in:
2025-07-20 19:35:20 +02:00
parent ca04fbc930
commit c13ec6cac4
3 changed files with 26 additions and 8 deletions

View File

@@ -3,6 +3,8 @@
enable = true;
email = "adam@cnst.dev";
domain = "cnst.dev";
uid = 994;
gid = 994;
caddy = {
enable = true;
};

View File

@@ -7,7 +7,7 @@
cfg = config.server;
in {
options.server = {
enable = lib.mkEnableOption "The homelab services and configuration variables";
enable = lib.mkEnableOption "The server services and configuration variables";
email = mkOption {
default = "";
type = types.str;
@@ -26,31 +26,46 @@ in {
default = "share";
type = lib.types.str;
description = ''
User to run the homelab services as
User to run the server services as
'';
};
group = lib.mkOption {
default = "share";
type = lib.types.str;
description = ''
Group to run the homelab services as
Group to run the server services as
'';
};
uid = lib.mkOption {
default = 1000;
type = lib.types.int;
description = ''
UID to run the server services as
'';
};
gid = lib.mkOption {
default = 1000;
type = lib.types.int;
description = ''
GID to run the server services as
'';
};
timeZone = lib.mkOption {
default = "Europe/Stockholm";
type = lib.types.str;
description = ''
Time zone to be used for the homelab services
Time zone to be used for the server services
'';
};
};
config = lib.mkIf cfg.enable {
users = {
groups.${cfg.group} = {
gid = 993;
gid = cfg.gid;
};
users.${cfg.user} = {
uid = 994;
uid = cfg.uid;
isSystemUser = true;
group = cfg.group;
};

View File

@@ -3,6 +3,7 @@
lib,
...
}: let
srv = config.server;
cfg = config.server.qbittorrent;
in {
options.server.qbittorrent = {
@@ -64,8 +65,8 @@ in {
config.age.secrets.gluetunEnv.path
];
environment = {
PUID = "1000";
PGID = "1000";
PUID = "${srv.uid}";
PGID = "${srv.gid}";
TZ = "Etc/UTC";
WEBUI_PORT = "${builtins.toString cfg.port}";
};