hydra: build nmigen docs

This commit is contained in:
Sebastien Bourdeauducq 2022-09-27 10:45:41 +08:00
parent 48af866c61
commit 7a9960df69
2 changed files with 29 additions and 5 deletions

View File

@ -2,7 +2,7 @@
"web": { "web": {
"enabled": 1, "enabled": 1,
"hidden": false, "hidden": false,
"description": "M-Labs website", "description": "Websites",
"nixexprinput": "nixScripts", "nixexprinput": "nixScripts",
"nixexprpath": "web.nix", "nixexprpath": "web.nix",
"checkinterval": 300, "checkinterval": 300,
@ -13,7 +13,8 @@
"inputs": { "inputs": {
"nixpkgs": { "type": "git", "value": "https://github.com/NixOS/nixpkgs.git nixos-22.05", "emailresponsible": false }, "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 }, "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 }
} }
} }
} }

29
web.nix
View File

@ -1,7 +1,30 @@
let let
pkgs = import <nixpkgs> {}; pkgs = import <nixpkgs> {};
src = <webSrc>; web-src = <webSrc>;
nmigen-src = <nmigenSrc>;
in in
{ rec {
web = pkgs.runCommand "web" {} "cd ${src}; ${pkgs.zola}/bin/zola build -o $out"; 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
'';
};
} }