-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
74 lines (65 loc) · 1.99 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
{
description = "LaTeX document at European Commission";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
theme-ec.url = "git+https://code.europa.eu/pol/european-commission-latex-beamer-theme/";
};
outputs = { self, nixpkgs, flake-utils, theme-ec, ... }@inputs:
with flake-utils.lib; eachSystem allSystems (system:
let
version = self.shortRev or self.lastModifiedDate;
overlays = [
theme-ec.overlays.default
];
pkgs = import nixpkgs {
inherit system overlays;
};
tex = pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-full latex-bin latexmk;
latex-theme-ec = {
pkgs = [ pkgs.latex-theme-ec ];
};
};
documentProperties = {
name = "ec-presentation";
inputs = [
tex
pkgs.coreutils
pkgs.gnumake
# pkgs.openjdk
pkgs.plantuml
# pkgs.pandoc
# pkgs.plantuml
# pkgs.nixpkgs-fmt
# pkgs.nixfmt
# pkgs.pympress
];
};
documentDrv = pkgs.stdenvNoCC.mkDerivation {
name = documentProperties.name + "-" + version;
src = self;
buildInputs = documentProperties.inputs;
configurePhase = ''
runHook preConfigure
substituteInPlace "src/session/version.tex" \
--replace "dev-local" "${version}"
runHook postConfigure
'';
installPhase = ''
runHook preInstall
cp build/session.pdf $out
runHook postInstall
'';
};
in
rec {
# Nix shell / nix build
packages.default = documentDrv;
# Nix develop
devShells.default = pkgs.mkShellNoCC {
name = documentProperties.name;
buildInputs = documentProperties.inputs;
};
});
}