From 7a9960df69a2610b9a1a88e8ab330b4738d20bc6 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 27 Sep 2022 10:45:41 +0800 Subject: [PATCH] hydra: build nmigen docs --- hydra/web.json | 5 +++-- web.nix | 29 ++++++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/hydra/web.json b/hydra/web.json index b9f4850..bd2908a 100644 --- a/hydra/web.json +++ b/hydra/web.json @@ -2,7 +2,7 @@ "web": { "enabled": 1, "hidden": false, - "description": "M-Labs website", + "description": "Websites", "nixexprinput": "nixScripts", "nixexprpath": "web.nix", "checkinterval": 300, @@ -13,7 +13,8 @@ "inputs": { "nixpkgs": { "type": "git", "value": "https://github.com/NixOS/nixpkgs.git nixos-22.05", "emailresponsible": false }, "nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }, - "webSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/web2019.git", "emailresponsible": false } + "webSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/web2019.git", "emailresponsible": false }, + "nmigenSrc": { "type": "git", "value": "https://gitlab.com/nmigen/nmigen.git", "emailresponsible": false } } } } diff --git a/web.nix b/web.nix index 108cd97..b1b5098 100644 --- a/web.nix +++ b/web.nix @@ -1,7 +1,30 @@ let pkgs = import {}; - src = ; + web-src = ; + nmigen-src = ; in - { - web = pkgs.runCommand "web" {} "cd ${src}; ${pkgs.zola}/bin/zola build -o $out"; + rec { + web = pkgs.runCommand "web" {} "cd ${web-src}; ${pkgs.zola}/bin/zola build -o $out"; + sphinxcontrib-platformpicker = pkgs.python3Packages.buildPythonPackage rec { + pname = "sphinxcontrib-platformpicker"; + version = "1.3"; + src = pkgs.fetchFromGitHub { + owner = "whitequark"; + repo = "sphinxcontrib-platformpicker"; + rev = "v${version}"; + sha256 = "sha256-qKhi4QqYhU7CbNSpziFacXc/sWWPSuM3Nc/oWPmBivM="; + }; + propagatedBuildInputs = [ pkgs.python3Packages.sphinx ]; + }; + nmigen-docs = pkgs.stdenvNoCC.mkDerivation { + name = "nmigen-docs"; + src = nmigen-src; + buildInputs = [ (pkgs.python3.withPackages(ps: [ ps.sphinx ps.sphinx_rtd_theme sphinxcontrib-platformpicker ])) ]; + phases = [ "buildPhase" ]; + buildPhase = + '' + export PYTHONPATH=$src + sphinx-build -b html $src/docs $out + ''; + }; }