From 1f78c62b56ad896937b95b7976defe9295952853 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 31 Jul 2022 17:17:03 +0200 Subject: [PATCH] packages/landing: add option to serve site directly via nix run --- packages/websites/landing/project.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/websites/landing/project.nix b/packages/websites/landing/project.nix index 22903f4..3759aba 100644 --- a/packages/websites/landing/project.nix +++ b/packages/websites/landing/project.nix @@ -38,7 +38,13 @@ in mkdir -p $out/share/www 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; }