From 6c370451b88be4d72d22ca59438ef71057404a9d Mon Sep 17 00:00:00 2001 From: Ciapa Date: Sun, 4 Feb 2024 19:38:04 +0100 Subject: [PATCH] Configure container for Wireguard NAT tests --- hosts/phoenix.lewd.wtf/configuration.nix | 1 + hosts/phoenix.lewd.wtf/containers/test.nix | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 hosts/phoenix.lewd.wtf/containers/test.nix diff --git a/hosts/phoenix.lewd.wtf/configuration.nix b/hosts/phoenix.lewd.wtf/configuration.nix index d6fe0fb..0297968 100644 --- a/hosts/phoenix.lewd.wtf/configuration.nix +++ b/hosts/phoenix.lewd.wtf/configuration.nix @@ -3,6 +3,7 @@ let utils = import ../../util/include.nix { lib = lib; }; imports = (utils.includeDir ./services) ++ + (utils.includeDir ./containers) ++ [ ./hardware-configuration.nix ./networking.nix diff --git a/hosts/phoenix.lewd.wtf/containers/test.nix b/hosts/phoenix.lewd.wtf/containers/test.nix new file mode 100644 index 0000000..efaad8f --- /dev/null +++ b/hosts/phoenix.lewd.wtf/containers/test.nix @@ -0,0 +1,21 @@ +{ + containers.test = { + autoStart = true; + privateNetwork = true; + hostAddress = "192.168.100.10"; + localAddress = "192.168.100.11"; + config = { config, pkgs, ... }: { + system.stateVersion = "24.05"; + + networking = { + firewall = { + enable = true; + allowedTCPPorts = [ 80 ]; + }; + useHostResolvConf = mkForce false; + }; + + services.resolved.enable = true; + }; + }; +}