-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.nix
More file actions
49 lines (43 loc) · 1.14 KB
/
default.nix
File metadata and controls
49 lines (43 loc) · 1.14 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
let
pkgs = import <nixpkgs> { };
docco = pkgs.buildNpmPackage rec {
pname = "docco";
version = "0.9.2";
src = pkgs.fetchFromGitHub {
owner = "jashkenas";
repo = "docco";
rev = version;
hash = "sha256-ze6T60oyVhzjFwg20QgO9WRcGH/9Yz1oNYTX2Tn9I7Y="; # You'll need to fill this in
};
npmDepsHash = "sha256-OexhFqXZJFj39Bg/nMQomLFVREiW9Z61fQ0d0ypCOlo=";
dontNpmBuild = true;
};
docs = pkgs.stdenv.mkDerivation {
name = "docs";
srcs = ./src;
tests = ./test;
docPage = ./docPage;
buildInputs = with pkgs; [
findutils
gnused
docco
];
buildPhase = ''
# Run docco to generate documentation
shopt -s globstar
mkdir src
cp -r $srcs/* src
mkdir test
cp -r $tests/* test
docco -t $docPage/page.jst -c $docPage/page.css src/**/*.hs test/**/*.hs
# Some doc lines begin with | because of Haddocks. This removes that.
find docs -type f -exec sed -i 's/<p>|/<p>/g' {} +
'';
installPhase = ''
# Copy docs to the output root
mkdir -p $out
cp -r docs/* $out/
'';
};
in
{ inherit docs; }