Profpatsch/third_party/overlays/sam/pkgs/by-name/synit-manual/package.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
41
42
43
44
{ lib
, stdenvNoCC
, fetchFromSyndicateLang
, ditaa
, mdbook
, python3
, python3Packages
}:

stdenvNoCC.mkDerivation {
  pname = "synit-service";
  version = "main";

  src = fetchFromSyndicateLang {
    owner = "synit";
    repo = "synit-manual";
    rev = "79bace4f94fc544a566740e610ac9e6d465383a2";
    hash = "sha256:0aj25xrnzs4fwkzjiyh4phs0spzlx3895bn39j35zzzbkdrxajmw";
  };

  nativeBuildInputs = [
    ditaa
    mdbook
    (python3.withPackages (_: [
      python3Packages.preserves
    ]))
  ];

  preBuild = ''
    patchShebangs mdbook-*
  '';

  installPhase = ''
    runHook preInstall
    mkdir -p $out/share/doc
    cp -r book $out/share/doc/synit-manual
    runHook postInstall
  '';

  meta = {
    description = "Synit documentation";
    license = lib.licenses.cc-by-40;
  };
}