From ab3cc0c21795fa09c96fbc22612112728fa78361 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Sun, 14 Jan 2024 21:52:48 +0100 Subject: [PATCH] vm: Serve www directory from a shared directory Run the VM as WWW="$PWD/www" nix run to serve the www directory from within the VM. --- module.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/module.nix b/module.nix index c497921..6a04b1f 100644 --- a/module.nix +++ b/module.nix @@ -6,7 +6,7 @@ virtualHosts.localhost.locations."/" = { index = "index.html"; - root = ./www; + root = "/var/www"; }; }; }; @@ -19,5 +19,10 @@ host.port = 8080; }]; + virtualisation.sharedDirectories.www = { + source = "$WWW"; + target = "/var/www"; + }; + system.stateVersion = "23.11"; }