diff --git a/hosts/sobotka/server.nix b/hosts/sobotka/server.nix index 0e46c959..2ffea3e2 100644 --- a/hosts/sobotka/server.nix +++ b/hosts/sobotka/server.nix @@ -3,6 +3,8 @@ enable = true; email = "adam@cnst.dev"; domain = "cnst.dev"; + uid = 994; + gid = 994; caddy = { enable = true; }; diff --git a/modules/server/default.nix b/modules/server/default.nix index 5f6e03d8..da9b8250 100644 --- a/modules/server/default.nix +++ b/modules/server/default.nix @@ -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; }; diff --git a/modules/server/qbittorrent/default.nix b/modules/server/qbittorrent/default.nix index 3d33b48d..6e8ebb0c 100644 --- a/modules/server/qbittorrent/default.nix +++ b/modules/server/qbittorrent/default.nix @@ -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}"; };