demo-vm/configuration.nix
Jermeiah S 1ef708bab8
repo cleanup
I moved things around to be easier to reason
2025-07-10 02:25:27 -04:00

44 lines
667 B
Nix

{
# config,
# lib,
pkgs,
...
}:
let
indexHtml = pkgs.writeText "index.html" ''
hello mofo
'';
in
{
imports = [
./base.nix
# ./microvm.nix
./vm-variant.nix
];
virtualisation.vmVariant = {
virtualisation = {
forwardPorts = [
{
from = "host";
host.port = 8888;
guest.port = 80;
}
];
};
};
services.nginx = {
enable = true;
virtualHosts."localhost" = {
root = "${pkgs.runCommand "nginx-root" { } ''
mkdir -p $out
cp ${indexHtml} $out/index.html
''}";
locations."/" = {
index = "index.html";
};
};
};
}