-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
40 lines (34 loc) · 958 Bytes
/
flake.nix
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
{
description = "The Zcash Trailing Finality Layer Book";
inputs.nixpkgs.url = "github:nixos/nixpkgs/23.11";
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages."${system}";
tfl-book-pkg = pkgs.stdenv.mkDerivation rec {
pname = "tfl-book";
version = "0.1.0"; # BUG: This should be derived from the `git describe --dirty`
buildInputs = with pkgs; [
graphviz
mdbook
mdbook-admonish
mdbook-graphviz
mdbook-linkcheck
mdbook-katex
];
src = ./.;
builder = pkgs.writeScript "${pname}-builder-${version}" ''
source "$stdenv/setup"
cp -a "$src" ./src
cd ./src
chmod -R u+w .
mdbook build
dest="$out/share/doc/${pname}/"
mkdir -p "$(dirname "$dest")"
cp -a ./build/html "$dest"
'';
};
in {
packages."${system}".default = tfl-book-pkg;
};
}