Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
56 lines (44 loc) · 1.38 KB
/
Copy pathflake.nix
File metadata and controls
56 lines (44 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
description = "Laya Vision: typed, calibrated decisions about an image (documentation site)";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
docsPython = pkgs.python3.withPackages (
ps: with ps; [
mkdocs
mkdocs-mermaid2-plugin
]
);
in
{
# nix build .#docs -> ./result: the MkDocs site (site-docs/)
packages.docs = pkgs.stdenvNoCC.mkDerivation {
pname = "laya-vision-docs";
version = "0.1.0";
src = self;
nativeBuildInputs = [ docsPython ];
dontConfigure = true;
strictDeps = true;
buildPhase = ''
runHook preBuild
python3 -m mkdocs build --strict
runHook postBuild
'';
installPhase = ''
runHook preInstall
cp -R site "$out"
runHook postInstall
'';
};
packages.default = self.packages.${system}.docs;
# nix develop -> mkdocs with the same plugins, for `mkdocs serve`
devShells.default = pkgs.mkShell {
packages = [ docsPython ];
};
});
}