From 5e51d5f25291a93f31a0326149b128686cca7368 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Sat, 6 Apr 2024 23:16:43 +0200 Subject: [PATCH] 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. --- websites/docs.hacc.space/default.nix | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/websites/docs.hacc.space/default.nix b/websites/docs.hacc.space/default.nix index e928834..cab23a7 100644 --- a/websites/docs.hacc.space/default.nix +++ b/websites/docs.hacc.space/default.nix @@ -1,23 +1,17 @@ -{ stdenvNoCC, zola, writeScriptBin }: +{ copyPathToStore, 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"; + src = ./.; + content = copyPathToStore ../../docs; phases = [ "buildPhase" ]; buildInputs = [ zola ]; buildPhase = '' cp -r $src/* . rm content - ln -s $src/../../docs content + ln -s $content content zola build --output-dir $out '';