From 68dc6402572b49b37acbc71c25b4265a2fb9d439 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Fri, 12 Jan 2024 00:31:32 +0100 Subject: [PATCH] fix docs.hacc.space MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this is a slightly cursed work around; see the comment. Alternatively, we could pass in the $src attribute of that derivation via callPackage (passing it through all the way from flake.nix), but tbh that sounds like too much effort rn. Have fun with confusingly long paths in the nix store 🙃 --- parsons/nginx-pages.nix | 2 +- websites/docs.hacc.space/default.nix | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/parsons/nginx-pages.nix b/parsons/nginx-pages.nix index a968446..6f128ad 100644 --- a/parsons/nginx-pages.nix +++ b/parsons/nginx-pages.nix @@ -4,7 +4,7 @@ { hacc.websites = { enable = true; - directory = ../websites; + directory = "${../.}/websites"; }; diff --git a/websites/docs.hacc.space/default.nix b/websites/docs.hacc.space/default.nix index c1c5453..6ccca5d 100644 --- a/websites/docs.hacc.space/default.nix +++ b/websites/docs.hacc.space/default.nix @@ -3,13 +3,21 @@ stdenvNoCC.mkDerivation rec { name = "docs.hacc.space-static"; - src = ./.; + # 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 = '' - cd $src - mkdir -p $out + cp -r $src/* . + rm content + ln -s $src/../../docs content zola build --output-dir $out '';