From 3c3b377004464e944548003aa49d897088f3589a Mon Sep 17 00:00:00 2001 From: Mel Date: Sun, 31 Aug 2025 17:46:49 +0200 Subject: Add MTU option to foundation service network options Signed-off-by: Mel --- modules/foundation/services/networks.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'modules') 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} ''; -- cgit 1.4.1