summary refs log tree commit diff
path: root/modules/foundation/services
diff options
context:
space:
mode:
authorMel <mel@rnrd.eu>2025-08-31 17:46:49 +0200
committerMel <mel@rnrd.eu>2025-08-31 17:46:49 +0200
commit3c3b377004464e944548003aa49d897088f3589a (patch)
tree302b62bc48fe43c7541c74d0ffa7aa97405d00db /modules/foundation/services
parentfcbc0446f11b8555c1204081c23fbd1442534aa0 (diff)
downloadnetwork-3c3b377004464e944548003aa49d897088f3589a.tar.zst
network-3c3b377004464e944548003aa49d897088f3589a.zip
Add MTU option to foundation service network options
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'modules/foundation/services')
-rw-r--r--modules/foundation/services/networks.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/foundation/services/networks.nix b/modules/foundation/services/networks.nix
index d1f1a92..e9adf6b 100644
--- a/modules/foundation/services/networks.nix
+++ b/modules/foundation/services/networks.nix
@@ -13,6 +13,7 @@ let
     types
     assertMsg
     optional
+    optionalString
     getExe
     concatStringsSep
     filterAttrs
@@ -65,6 +66,16 @@ in
               description = "Docker network driver to use";
             };
 
+            mtu = mkOption {
+              type = types.nullOr types.int;
+              default = null;
+              example = 1400;
+              description = ''
+                The MTU for this network.
+                If null, we use the Docker default.
+              '';
+            };
+
             options = mkOption {
               type = types.listOf types.str;
               default = [ ];
@@ -195,6 +206,7 @@ in
                   --ipv6 \
                   --subnet=${subnet} \
                   --driver=${network.driver} \
+                  ${optionalString (network.mtu != null) "--opt com.docker.network.driver.mtu=${toString network.mtu}"} \
                   ${options} \
                   ${name}
               '';