-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
95 lines (91 loc) · 2.98 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
{
description = "An Active Group presentation";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/master";
flake-utils.url = "github:numtide/flake-utils";
revealjs = {
url = "github:hakimel/reveal.js";
flake = false;
};
mathjax = {
url = "github:mathjax/mathjax";
flake = false;
};
plantumlC4 = {
url = "github:plantuml-stdlib/c4-plantuml";
flake = false;
};
plantumlEIP = {
url = "github:plantuml-stdlib/EIP-PlantUML";
flake = false;
};
decktape = {
url = "github:astefanutti/decktape";
flake = false;
};
};
outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
let
supportedSystems = with flake-utils.lib.system; [
x86_64-linux
x86_64-darwin
aarch64-darwin
];
in flake-utils.lib.eachSystem supportedSystems (system:
let
pkgs = import nixpkgs { inherit system; };
emacs = pkgs.emacs.pkgs.withPackages (p: [
p.org-re-reveal
p.gnuplot
p.gnuplot-mode
p.haskell-mode
p.clojure-mode
]);
in {
apps = {
# The default target for `nix run`. This builds the
# reveal.js slides.
default = let
app = pkgs.writeShellScript "org-re-reveal" ''
if [ ! -e plantuml/plugins ]; then
mkdir -p plantuml/plugins
ln -snf ${inputs.plantumlC4}/*.puml plantuml/plugins/.
echo Symlinked PlantUML C4 to ./plantuml/plugins
ln -snf ${inputs.plantumlEIP}/dist/*.puml plantuml/plugins/.
echo Symlinked PlantUML EIP to ./plantuml/plugins
fi
export REVEAL_ROOT="${inputs.revealjs}"
export REVEAL_MATHJAX_URL=
export PATH=${pkgs.plantuml}/bin:${pkgs.gnuplot}/bin:$PATH
echo $@
${emacs}/bin/emacs --batch -q -l export.el \
--eval="(org-re-reveal-export-file \"$@\" \"${inputs.revealjs}\" \"${inputs.mathjax}/es5/tex-chtml.js\")"
'';
in {
type = "app";
program = "${app}";
};
# May be used to create the PDF version of the talk. See the
# Makefile for an actual invocation.
decktape = let
decktapeWithDependencies = pkgs.stdenv.mkDerivation {
name = "decktape-with-dependencies";
src = inputs.decktape;
buildInputs = [ pkgs.nodejs ];
buildPhase = "HOME=$TMP npm install";
installPhase = "cp -r . $out";
};
app = pkgs.writeShellScript "run-decktape"
"${pkgs.nodejs}/bin/node ${decktapeWithDependencies}/decktape.js $@";
in {
type = "app";
program = "${app}";
};
pdfunite = let poppler = pkgs.poppler_utils;
in {
type = "app";
program = "${poppler}/bin/pdfunite";
};
};
});
}