44 lines
667 B
Nix
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";
|
|
};
|
|
};
|
|
};
|
|
|
|
}
|