forked from hendricius/the-sourdough-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
38 lines (38 loc) · 1.27 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
{
description = "book builder";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-22.11;
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-basic latex-bin latexmk blindtext pgf pgfplots booktabs filecontents float tocloft biblatex parskip caption metafont cm-super;
};
in rec {
packages = {
document = pkgs.stdenvNoCC.mkDerivation rec {
name = "book";
src = self;
buildInputs = [ pkgs.coreutils tex pkgs.gnumake pkgs.gawk pkgs.biber];
phases = ["unpackPhase" "buildPhase" "installPhase"];
buildPhase = ''
export PATH="${pkgs.lib.makeBinPath buildInputs}";
mkdir -p .cache/texmf-var
cd book/
env TEXMFHOME=.cache TEXMFVAR=.cache/texmf-var \
#latexmk -interaction=nonstopmode -pdf -pdflatex \
make
cd ..
'';
installPhase = ''
mkdir -p $out
cp book/book.pdf $out/
'';
};
};
defaultPackage = packages.document;
});
}