-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathhoh.nix
More file actions
51 lines (46 loc) · 1.21 KB
/
hoh.nix
File metadata and controls
51 lines (46 loc) · 1.21 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
{ pkgs
, target ? "html"
}:
let
pythonEnv = pkgs.python313.withPackages (ps: with ps;
[ sphinx
sphinxcontrib-tikz
sphinx-autobuild
sphinxawesome-theme
sphinx-copybutton # this comes from the overlay
sphinxcontrib-bibtex # from overlay
# sphinx-exec-directive
pip
]);
nonPythonInputs = with pkgs; [ rst2html5
ghc
cabal-install
git
tex-env
];
in
pkgs.stdenv.mkDerivation {
pname = "hoh";
version = "0.0.1";
src = ./.;
phases = [ "unpackPhase" "preBuild" "buildPhase" "installPhase"];
buildInputs = [pythonEnv] ++ nonPythonInputs;
preBuild = ''
unset SOURCE_DATE_EPOCH
export CABAL_DIR=$(mktemp -d)
cabal user-config update
'';
buildPhase = ''
runHook preBuild
export PATH="${pkgs.lib.makeBinPath (nonPythonInputs)}:$PATH";
SOURCE_DATE_EPOCH="$(${pkgs.coreutils}/bin/date '+%s')"
make clean
make ${target} SPHINXOPTS="-W"
touch "_build/.nojekyll"
touch "_build/html/.nojekyll"
'';
installPhase = ''
mkdir -p $out/
cp -r _build/${target}/ $out/
'';
}