-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
42 lines (39 loc) · 1.38 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
{
description = "LaTeX Document on Regular Languages and Automata";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
with flake-utils.lib;
eachSystem allSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
tex =
pkgs.texlive.combine { inherit (pkgs.texlive) scheme-full latexmk; };
in rec {
packages = {
document = pkgs.stdenvNoCC.mkDerivation rec {
name = "latex-regular-automata";
src = self;
buildInputs = [ pkgs.coreutils tex ];
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
buildPhase = ''
export PATH="${pkgs.lib.makeBinPath buildInputs}";
mkdir -p .cache/texmf-var
env TEXMFHOME=.cache TEXMFVAR=.cache/texmf-var \
latexmk -interaction=nonstopmode -pdf -lualatex \
report.tex
env TEXMFHOME=.cache TEXMFVAR=.cache/texmf-var \
latexmk -interaction=nonstopmode -pdf -lualatex \
presentation.tex
'';
installPhase = ''
mkdir -p $out
cp report.pdf presentation.pdf $out/
'';
};
};
defaultPackage = packages.document;
});
}