From f50e3a9f75b03845854ee980cead8270a7693653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Fri, 15 Nov 2024 14:17:47 +0100 Subject: [PATCH] add network access to postgresql container --- containers/postgresql-configuration.nix | 2 ++ modules/containers/host.nix | 15 +++++++++++++++ modules/default.nix | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 modules/containers/host.nix diff --git a/containers/postgresql-configuration.nix b/containers/postgresql-configuration.nix index f25c7ca7..8429422f 100644 --- a/containers/postgresql-configuration.nix +++ b/containers/postgresql-configuration.nix @@ -4,4 +4,6 @@ config = import ./postgresql.nix; autoStart = true; privateNetwork = true; + hostBridge = "containers"; + localAddress6 = "fdc6:e7e5:0ba1:1::2/64"; } diff --git a/modules/containers/host.nix b/modules/containers/host.nix new file mode 100644 index 00000000..43a2a518 --- /dev/null +++ b/modules/containers/host.nix @@ -0,0 +1,15 @@ +{ ... }: +{ + imports = [ + ./autoconfig.nix + ]; + networking.interfaces.containers = { + ipv6.addresses = [ + { + address = "fdc6:e7e5:0ba1:1::1"; + prefixLength = 64; + } + ]; + }; + networking.bridges.containers.interfaces = [ ]; +} diff --git a/modules/default.nix b/modules/default.nix index 40a87e14..1d1b26bc 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -12,7 +12,7 @@ with lib; { imports = [ ./riscv.nix - ./containers/autoconfig.nix + ./containers/host.nix ./nix ./environment/impermanence.nix ./secrets/sops.nix