mirror of
https://git.adityakumar.xyz/flakes.git
synced 2024-11-09 22:19:45 +00:00
add flake-latex
This commit is contained in:
parent
fd71d74d4e
commit
31259cface
1 changed files with 36 additions and 0 deletions
36
flake-latex.nix
Normal file
36
flake-latex.nix
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
{
|
||||||
|
description = "LaTeX Document Demo";
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = github:NixOS/nixpkgs/nixos-23.05;
|
||||||
|
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 pgf nicematrix latex-bin latexmk;
|
||||||
|
};
|
||||||
|
in rec {
|
||||||
|
packages = {
|
||||||
|
document = pkgs.stdenvNoCC.mkDerivation rec {
|
||||||
|
name = "latex-demo-document";
|
||||||
|
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 \
|
||||||
|
document.tex
|
||||||
|
'';
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
cp document.pdf $out/
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
defaultPackage = packages.document;
|
||||||
|
});
|
||||||
|
}
|
Loading…
Reference in a new issue