-
Notifications
You must be signed in to change notification settings - Fork 12
/
flake.nix
99 lines (86 loc) · 3.15 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{
description = "Haskell Optimization Handbook flake";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils, flake-compat }:
let press-theme-overlay = final: prev: {
sphinx-press-theme = prev.python311Packages.buildPythonPackage rec {
pname = "sphinx_press_theme";
version = "0.8.0";
src = prev.python311Packages.fetchPypi {
inherit pname;
inherit version;
sha256 = "sha256-KITKqx3AHssR0VjU3W0xeeLdl81IUWx2nMJzYCcuYrM=";
};
propagatedBuildInputs = [ prev.sphinx ];
};
};
copy-button-overlay = final: prev: {
sphinx-copybutton = prev.python311Packages.buildPythonPackage rec {
pname = "sphinx-copybutton";
version = "0.5.2";
src = prev.python311Packages.fetchPypi {
inherit pname;
inherit version;
sha256 = "sha256-TPF8gvuWRtG8nKkqwoCBOjtgXYxCEiX9mRMVQQPuH70=";
};
propagatedBuildInputs = [ prev.sphinx ];
};
};
sphinx-exec-directive-overlay = final: prev: {
sphinx-exec-directive = prev.python311Packages.buildPythonPackage rec {
pname = "sphinx-exec-directive";
version = "0.6";
src = prev.python311Packages.fetchPypi {
inherit pname;
inherit version;
sha256 = "sha256-lMo4QILqt6pEiIatN/LNxhiUGX3ziSWV+bfRahzmZWU=";
};
propagatedBuildInputs = [ prev.sphinx prev.python311Packages.matplotlib ];
};
};
tex-overlay = final: prev: {
tex-env = prev.texlive.combine {
inherit (prev.texlive)
scheme-basic collection-xetex fncychap titlesec tabulary varwidth
framed capt-of wrapfig needspace dejavu-otf helvetic upquote
memorygraphs;
};
};
in
flake-utils.lib.eachDefaultSystem
(system:
let pkgs = import nixpkgs
{ inherit system;
overlays = [ press-theme-overlay
copy-button-overlay
sphinx-exec-directive-overlay
tex-overlay
];
} ;
## TODO use this
fonts = pkgs.makeFontsConf { fontDirectories = [ pkgs.dejavu_fonts ]; };
in
rec {
packages = {
default = import ./hoh.nix { inherit pkgs;
target = "html";
};
epub = import ./hoh.nix { inherit pkgs;
target = "epub";
};
pdf = import ./hoh.nix { inherit pkgs;
target = "pdf";
};
};
devShells = {
default = packages.default;
};
}
);
}