From 006ca4b2496ec79296beb648f5964e628255caf8 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Wed, 4 Mar 2020 06:20:34 +0800 Subject: [PATCH] nextcloud: add nat to container --- configs/workhorse/nextcloud.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configs/workhorse/nextcloud.nix b/configs/workhorse/nextcloud.nix index 306b5cd..d04f955 100644 --- a/configs/workhorse/nextcloud.nix +++ b/configs/workhorse/nextcloud.nix @@ -1,5 +1,6 @@ { pkgs, ... }: { + # setup nextcloud in a container containers.nextcloud = { bindMounts = { @@ -44,6 +45,14 @@ }; }; + # give containers internet access + networking.nat.enable = true; + networking.nat.internalInterfaces = [ "ve-nextcloud" ]; + networking.nat.externalInterface = "eth0"; + + # don't let networkmanager manger container network + networking.networkmanager.unmanaged = [ "interface-name:ve-*" ]; + # host nginx setup services.nginx = { enable = true;