From 5dacfc270522cd6f3714029c0aac810a7bf6e86e Mon Sep 17 00:00:00 2001 From: zimbatm Date: Thu, 12 Sep 2024 16:24:47 +0000 Subject: [PATCH] fix(devshell): work around godoc not supporting riscv5 --- nix/devshells/docs.nix | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/nix/devshells/docs.nix b/nix/devshells/docs.nix index 53eaf6c..3113f97 100644 --- a/nix/devshells/docs.nix +++ b/nix/devshells/docs.nix @@ -5,21 +5,23 @@ }: pkgs.mkShellNoCC { packages = with pkgs; - [ - perSystem.godoc.default - (pkgs.writeScriptBin "gen-reference" '' - out="./docs/content/reference/go_doc" - godoc -c -o $out . - '') - (pkgs.writeScriptBin "mkdocs" '' - # generate reference docs first - gen-reference - # execute the underlying command - ${pkgs.mkdocs}/bin/mkdocs "$@" - '') - ] - ++ (with pkgs.python3Packages; [ - mike - mkdocs-material - ]); + # Pop an empty shell on systems that aren't supported by godoc + lib.optionals (perSystem.godoc ? default) + ([ + perSystem.godoc.default + (pkgs.writeScriptBin "gen-reference" '' + out="./docs/content/reference/go_doc" + godoc -c -o $out . + '') + (pkgs.writeScriptBin "mkdocs" '' + # generate reference docs first + gen-reference + # execute the underlying command + ${pkgs.mkdocs}/bin/mkdocs "$@" + '') + ] + ++ (with pkgs.python3Packages; [ + mike + mkdocs-material + ])); }