From 1846d4d2ccef64ee1abd93449355163431c68a26 Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Tue, 30 Jul 2024 20:09:12 +0200 Subject: [PATCH] pinwheel/test-vm: Move development of `ppp.pm-site` to `test-vm` --- hosts/pinwheel/modules/default.nix | 1 - hosts/test-vm/configuration.nix | 8 ++++++-- .../default.nix => test-vm/ppp.pm-site.nix} | 16 +++++++++++++++- 3 files changed, 21 insertions(+), 4 deletions(-) rename hosts/{pinwheel/modules/ppp.pm-site/default.nix => test-vm/ppp.pm-site.nix} (56%) diff --git a/hosts/pinwheel/modules/default.nix b/hosts/pinwheel/modules/default.nix index 0f5d693..8f51d36 100644 --- a/hosts/pinwheel/modules/default.nix +++ b/hosts/pinwheel/modules/default.nix @@ -40,7 +40,6 @@ in }; vm.enable = true; scripts.enable = true; - pppdotpm-site.enable = false; }; }; } diff --git a/hosts/test-vm/configuration.nix b/hosts/test-vm/configuration.nix index d6c5e2c..27321b8 100644 --- a/hosts/test-vm/configuration.nix +++ b/hosts/test-vm/configuration.nix @@ -1,13 +1,17 @@ { pkgs, ... }: { - imports = []; + imports = [ + ./ppp.pm-site.nix + ]; config = { boot.kernelPackages = pkgs.linuxPackages_latest; networking.hostName = "test-vm"; - mod = {}; + mod = { + pppdotpm-site.enable = true; + }; users.users.a = { isNormalUser = true; diff --git a/hosts/pinwheel/modules/ppp.pm-site/default.nix b/hosts/test-vm/ppp.pm-site.nix similarity index 56% rename from hosts/pinwheel/modules/ppp.pm-site/default.nix rename to hosts/test-vm/ppp.pm-site.nix index d0a72f4..8cb9eba 100644 --- a/hosts/pinwheel/modules/ppp.pm-site/default.nix +++ b/hosts/test-vm/ppp.pm-site.nix @@ -17,6 +17,20 @@ in domain = "ppp.pm.local"; }; - networking.extraHosts = "127.0.0.1 ppp.pm.local"; + networking = { + firewall.allowedTCPPorts = [ 80 ]; + }; + + virtualisation.vmVariant = { + virtualisation = { + forwardPorts = [ + { + from = "host"; + host.port = 8080; + guest.port = 80; + } + ]; + }; + }; }; }