add port option

This commit is contained in:
Joseph Hanson 2024-09-06 20:59:41 -05:00
parent 52fccdd546
commit cbfd905378
2 changed files with 13 additions and 1 deletions

View file

@ -134,6 +134,7 @@ in
devices = disks; devices = disks;
extraCapabilities = [ "SYS_RAWIO" ]; extraCapabilities = [ "SYS_RAWIO" ];
containerVolumeLocation = "/eru/containers/volumes/scrutiny"; containerVolumeLocation = "/eru/containers/volumes/scrutiny";
port = 8585;
}; };
# Sanoid # Sanoid

View file

@ -10,6 +10,16 @@ in
options.mySystem.services.${app} = { options.mySystem.services.${app} = {
enable = mkEnableOption "${app}"; enable = mkEnableOption "${app}";
# Port to expose the web ui on.
port = mkOption {
type = types.int;
default = 8080;
description = ''
Port to expose the web ui on.
'';
example = 8080;
};
# Location where the container will store its data.
containerVolumeLocation = mkOption { containerVolumeLocation = mkOption {
type = types.str; type = types.str;
default = "/mnt/data/containers/${app}"; default = "/mnt/data/containers/${app}";
@ -18,6 +28,7 @@ in
''; '';
example = "/mnt/data/containers/${app}"; example = "/mnt/data/containers/${app}";
}; };
# podman equivalent: # podman equivalent:
# --device /dev/disk/by-id/nvme-XXXXXXXXXXXXXXXXXXXXXXXXXXXX # --device /dev/disk/by-id/nvme-XXXXXXXXXXXXXXXXXXXXXXXXXXXX
devices = mkOption { devices = mkOption {
@ -53,7 +64,7 @@ in
autoStart = true; autoStart = true;
ports = [ ports = [
"8585:8585" # web ui "${toString cfg.port}:8080" # web ui
"8086:8086" # influxdb2 "8086:8086" # influxdb2
]; ];