From cbfd905378a78296bc292addcd3b3e90af5113dd Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Fri, 6 Sep 2024 20:59:41 -0500 Subject: [PATCH] add port option --- nixos/hosts/gandalf/default.nix | 1 + nixos/modules/nixos/containers/scrutiny/default.nix | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/nixos/hosts/gandalf/default.nix b/nixos/hosts/gandalf/default.nix index 8e50204..418ba98 100644 --- a/nixos/hosts/gandalf/default.nix +++ b/nixos/hosts/gandalf/default.nix @@ -134,6 +134,7 @@ in devices = disks; extraCapabilities = [ "SYS_RAWIO" ]; containerVolumeLocation = "/eru/containers/volumes/scrutiny"; + port = 8585; }; # Sanoid diff --git a/nixos/modules/nixos/containers/scrutiny/default.nix b/nixos/modules/nixos/containers/scrutiny/default.nix index 7d8881e..60dd0fe 100644 --- a/nixos/modules/nixos/containers/scrutiny/default.nix +++ b/nixos/modules/nixos/containers/scrutiny/default.nix @@ -10,6 +10,16 @@ in options.mySystem.services.${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 { type = types.str; default = "/mnt/data/containers/${app}"; @@ -18,6 +28,7 @@ in ''; example = "/mnt/data/containers/${app}"; }; + # podman equivalent: # --device /dev/disk/by-id/nvme-XXXXXXXXXXXXXXXXXXXXXXXXXXXX devices = mkOption { @@ -53,7 +64,7 @@ in autoStart = true; ports = [ - "8585:8585" # web ui + "${toString cfg.port}:8080" # web ui "8086:8086" # influxdb2 ];