blob: 97ae895d74e8a6e196cae0122f9b93020a99984b (
plain)
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
100
101
102
103
104
105
106
|
{
description = "My epic presentation";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.beamertheme-metropolis = {
url = "github:matze/mtheme";
flake = false;
};
inputs.draculaTheme = {
url = "github:dracula/pygments";
flake = false;
};
outputs = { self, nixpkgs, beamertheme-metropolis, draculaTheme, }:
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
in
{
packages.x86_64-linux.pygments = pkgs.python3Packages.pygments.overrideAttrs (oldAttrs: {
postPatch = ''
cp ${draculaTheme}/dracula.py pygments/styles/
sed -i 's/bg:.\+ //' pygments/styles/inkpot.py
'';
});
defaultPackage.x86_64-linux =
let
beamertheme-metropolis' = pkgs.stdenvNoCC.mkDerivation {
pname = "texlive-beamertheme-metropolis";
version = "${builtins.substring 0 8 beamertheme-metropolis.lastModifiedDate}-${beamertheme-metropolis.shortRev or "dirty"}";
src = beamertheme-metropolis;
outputs = [ "out" "doc" ];
nativeBuildInputs = with pkgs; [
(texlive.combine {
inherit (texlive)
scheme-small
enumitem
fileinfo
latexmk;
})
];
passthru = {
pname = "beamertheme-metropolis";
tlType = "run";
};
DESTDIR = placeholder "out";
dontConfigure = true;
};
in
pkgs.runCommand "slides"
{
src = ./.;
nativeBuildInputs = with pkgs; [
pandoc
self.packages.x86_64-linux.pygments
fira-code
which
(texlive.combine {
inherit (texlive)
scheme-medium
latexmk
beamercolorthemeowl
tcolorbox environ
fvextra pgfopts minted catchfile upquote xstring framed;
beamertheme-metropolis = { pkgs = [ beamertheme-metropolis' ]; };
})
];
FONTCONFIG_FILE = pkgs.makeFontsConf {
fontDirectories = with pkgs; [ lmodern freefont_ttf fira fira-code ];
};
} ''
unpackFile $src
cd */
chmod -R u+w .
pandoc slides.md -t beamer -so slides.tex \
--template=template.latex \
--lua-filter=${pkgs.pandoc-lua-filters}/share/pandoc/filters/minted.lua \
--pdf-engine=xelatex \
--pdf-engine-opt=-aux-directory=./build \
--pdf-engine-opt=-shell-escape
latexmk \
-shell-escape \
-xelatex \
-8bit \
-interaction=nonstopmode \
-verbose \
-file-line-error \
-output-directory=./build slides
cp build/slides.pdf $out
'';
# TODO: diagram-generator?
};
}
|