docs: do not rebuild on each change

this does slight tweaking of paths to make the docs.hacc.space
derivation no longer depend on our entire flake, so we won't have to
rebuild it as often.
This commit is contained in:
stuebinm 2024-04-06 23:16:43 +02:00
parent 069236027c
commit 5e51d5f252

View file

@ -1,23 +1,17 @@
{ stdenvNoCC, zola, writeScriptBin }: { copyPathToStore, stdenvNoCC, zola, writeScriptBin }:
stdenvNoCC.mkDerivation rec { stdenvNoCC.mkDerivation rec {
name = "docs.hacc.space-static"; name = "docs.hacc.space-static";
# HINT: this is cursed. Nix flakes have no optimisation to deal with ${./.}, src = ./.;
# so we wind up having to do this to make the symlink to content/ work. content = copyPathToStore ../../docs;
# (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" ]; phases = [ "buildPhase" ];
buildInputs = [ zola ]; buildInputs = [ zola ];
buildPhase = '' buildPhase = ''
cp -r $src/* . cp -r $src/* .
rm content rm content
ln -s $src/../../docs content ln -s $content content
zola build --output-dir $out zola build --output-dir $out
''; '';