summary refs log tree commit diff
path: root/modules/foundation
diff options
context:
space:
mode:
Diffstat (limited to 'modules/foundation')
-rw-r--r--modules/foundation/services.nix19
1 files changed, 12 insertions, 7 deletions
diff --git a/modules/foundation/services.nix b/modules/foundation/services.nix
index d4edcb3..ddc3263 100644
--- a/modules/foundation/services.nix
+++ b/modules/foundation/services.nix
@@ -27,7 +27,9 @@ let
       };
 
       ports = mkOption {
-        type = with types; listOf (listOf ints.u16);
+        type = with types; listOf (
+          either (listOf ints.u16) str
+        );
         default = [ ];
       };
 
@@ -132,12 +134,15 @@ in
     virtualisation.oci-containers.containers =
       let
         mkOciPort =
-          portTuple:
-          let
-            host = builtins.elemAt portTuple 0;
-            container = builtins.elemAt portTuple 1;
-          in
-          "127.0.0.1:${toString host}:${toString container}";
+          portStrOrTuple:
+          if builtins.isList portStrOrTuple then
+            let
+              host = builtins.elemAt portStrOrTuple 0;
+              container = builtins.elemAt portStrOrTuple 1;
+            in
+            "127.0.0.1:${toString host}:${toString container}"
+          else
+            portStrOrTuple;
 
         mkOciVolume =
           volumeTuple: