From ca6255bf0bc158481e39d6a8d2d5b554cccf77e2 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Thu, 13 May 2021 10:26:45 +0000 Subject: [PATCH] nixos/docker: fix evaluation when NAT is enabled too Both networking.nat.enable and virtualisation.docker.enable now want to make sure that the IP forwarding sysctl is enabled, but the module system dislikes that both modules contain this option. Realistically this should be refactored a bit, so that the Docker module automatically enables the NAT module instead, but this is a more obvious fix. --- nixos/modules/virtualisation/docker.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/virtualisation/docker.nix b/nixos/modules/virtualisation/docker.nix index 954e33ff24a3..29f133786d8d 100644 --- a/nixos/modules/virtualisation/docker.nix +++ b/nixos/modules/virtualisation/docker.nix @@ -151,8 +151,8 @@ in config = mkIf cfg.enable (mkMerge [{ boot.kernelModules = [ "bridge" "veth" ]; boot.kernel.sysctl = { - "net.ipv4.conf.all.forwarding" = mkOverride 99 true; - "net.ipv4.conf.default.forwarding" = mkOverride 99 true; + "net.ipv4.conf.all.forwarding" = mkOverride 98 true; + "net.ipv4.conf.default.forwarding" = mkOverride 98 true; }; environment.systemPackages = [ cfg.package ] ++ optional cfg.enableNvidia pkgs.nvidia-docker;