From 2297f31339cc3698e490b4dbdc7e14205d1c2f30 Mon Sep 17 00:00:00 2001 From: Jaka Hudoklin Date: Fri, 13 Dec 2013 10:24:50 +0100 Subject: [PATCH] nixos/network-interfaces: do not try to enable or disable ipv6 in container --- nixos/modules/tasks/network-interfaces.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nixos/modules/tasks/network-interfaces.nix b/nixos/modules/tasks/network-interfaces.nix index 9619f0f5ebe..bbfcb62c5d7 100644 --- a/nixos/modules/tasks/network-interfaces.nix +++ b/nixos/modules/tasks/network-interfaces.nix @@ -401,9 +401,11 @@ in EOF # Disable or enable IPv6. - if [ -e /proc/sys/net/ipv6/conf/all/disable_ipv6 ]; then - echo ${if cfg.enableIPv6 then "0" else "1"} > /proc/sys/net/ipv6/conf/all/disable_ipv6 - fi + ${optionalString (!config.boot.isContainer) '' + if [ -e /proc/sys/net/ipv6/conf/all/disable_ipv6 ]; then + echo ${if cfg.enableIPv6 then "0" else "1"} > /proc/sys/net/ipv6/conf/all/disable_ipv6 + fi + ''} # Set the default gateway. ${optionalString (cfg.defaultGateway != "") ''