forked from hacc/haccfiles
stuebinm
12e4cba3e6
nix run .#\"<domain>\" will now actually listen for changes in the source repository, and not first copy the entire thing into the nix store.
28 lines
876 B
Nix
28 lines
876 B
Nix
{ stdenvNoCC, zola, writeScriptBin }:
|
|
|
|
stdenvNoCC.mkDerivation rec {
|
|
name = "docs.hacc.space-static";
|
|
|
|
# HINT: this is cursed. Nix flakes have no optimisation to deal with ${./.},
|
|
# so we wind up having to do this to make the symlink to content/ work.
|
|
# (we still need to manually adjust it — but at least this way we can find
|
|
# its target without further hoops)
|
|
#
|
|
# This does also mean we now copy the entire flake into the Nix store twice.
|
|
# Yay for flakes!
|
|
src = "${../../.}/websites/docs.hacc.space";
|
|
|
|
phases = [ "buildPhase" ];
|
|
buildInputs = [ zola ];
|
|
buildPhase = ''
|
|
cp -r $src/* .
|
|
rm content
|
|
ln -s $src/../../docs content
|
|
zola build --output-dir $out
|
|
'';
|
|
|
|
watch = writeScriptBin "watch" ''
|
|
cd $(git rev-parse --show-toplevel)/websites/docs.hacc.space
|
|
${zola}/bin/zola serve --output-dir /tmp/hacc-docs "$@"
|
|
'';
|
|
}
|