diff options
author | volth <volth@volth.com> | 2020-08-06 02:12:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-05 21:12:57 -0500 |
commit | 7503f280c83122c93c5d74d561c48fee1e8f8a41 (patch) | |
tree | 86ea964bae90e217622a87c1e4a07a0c2a4c65c0 /nixos/modules/tasks/network-interfaces-scripted.nix | |
parent | 8d57f75f7a1d04ecbf30333c104c9124cfca9331 (diff) | |
download | nixlib-7503f280c83122c93c5d74d561c48fee1e8f8a41.tar nixlib-7503f280c83122c93c5d74d561c48fee1e8f8a41.tar.gz nixlib-7503f280c83122c93c5d74d561c48fee1e8f8a41.tar.bz2 nixlib-7503f280c83122c93c5d74d561c48fee1e8f8a41.tar.lz nixlib-7503f280c83122c93c5d74d561c48fee1e8f8a41.tar.xz nixlib-7503f280c83122c93c5d74d561c48fee1e8f8a41.tar.zst nixlib-7503f280c83122c93c5d74d561c48fee1e8f8a41.zip |
nixos/systemd: fix TUN networking in LXC containers (#81481)
in LXC container /dev/net/tun is pre-available, "dev-net-tun.device" always fails
Diffstat (limited to 'nixos/modules/tasks/network-interfaces-scripted.nix')
-rw-r--r-- | nixos/modules/tasks/network-interfaces-scripted.nix | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/tasks/network-interfaces-scripted.nix b/nixos/modules/tasks/network-interfaces-scripted.nix index 2e87197176b6..9ba6ccfbe716 100644 --- a/nixos/modules/tasks/network-interfaces-scripted.nix +++ b/nixos/modules/tasks/network-interfaces-scripted.nix @@ -253,8 +253,8 @@ let createTunDevice = i: nameValuePair "${i.name}-netdev" { description = "Virtual Network Interface ${i.name}"; - bindsTo = [ "dev-net-tun.device" ]; - after = [ "dev-net-tun.device" "network-pre.target" ]; + bindsTo = optional (!config.boot.isContainer) "dev-net-tun.device"; + after = optional (!config.boot.isContainer) "dev-net-tun.device" ++ [ "network-pre.target" ]; wantedBy = [ "network-setup.service" (subsystemDevice i.name) ]; partOf = [ "network-setup.service" ]; before = [ "network-setup.service" ]; |