packages/landing: add option to serve site directly via nix run

This commit is contained in:
Max Headroom 2022-07-31 17:17:03 +02:00
parent c81e351e63
commit 1f78c62b56

View file

@ -38,7 +38,13 @@ in
mkdir -p $out/share/www mkdir -p $out/share/www
hugo ${hugoArgsStr} -s $sourceRoot -d $out/share/www/${pname} hugo ${hugoArgsStr} -s $sourceRoot -d $out/share/www/${pname}
''; '';
passthru.webroot = "${site}/share/www/${site.pname}"; passthru = {
webroot = "${site}/share/www/${site.pname}";
serve = writeShellScriptBin "serve-site" ''
command -v xdg-open >/dev/null && xdg-open http://127.0.0.1:1314 || true
${darkhttpd}/bin/darkhttpd ${site.webroot} --addr 127.0.0.1 --port 1314
'';
};
}; };
in site; in site;
} }