html.nix/examples/serve.nix
2021-05-15 04:15:00 +03:00

23 lines
423 B
Nix

{ tags, pkgsLib, pkgs ? import <nixpkgs> { overlays = [ pkgsLib ]; } }:
with pkgs.htmlNix;
let
index = with tags;
html [
(body [
(p "Hello world!")
(link "./ex.html" "say bye")
])
];
ex = with tags;
html [
(body [
(p "Bye world!")
(link "./index.html" "go back")
])
];
site = { "index.html" = index; "ex.html" = ex; };
in
mkServeFromSite site