Skip to content

Instantly share code, notes, and snippets.

@erooke
Created April 30, 2020 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erooke/40b016bed6c837034ba8d2b7bb986835 to your computer and use it in GitHub Desktop.
Save erooke/40b016bed6c837034ba8d2b7bb986835 to your computer and use it in GitHub Desktop.
let
sources = import ./nix/sources.nix;
pkgs = import sources.nixpkgs {};
rooke = (pkgs.callPackage (import sources.rooke-tex) {});
in
pkgs.stdenv.mkDerivation {
name = "latex-test";
src = ./src;
buildInputs = [
pkgs.nixpkgs-fmt
(
pkgs.texlive.combine {
inherit (pkgs.texlive)
scheme-small
latexmk
;
inherit rooke;
}
)
];
phases = [ "unpackPhase" "buildPhase" "installPhase"];
buildPhase = ''
latexmk -pdfxe doc.tex
'';
installPhase =''
cp doc.pdf $out
'';
}
{ stdenv, texlive }:
let
rooke-tex = stdenv.mkDerivation {
name = "latex-rooke";
pname = "latex-rooke";
version = "0.0.1";
tlType = "run";
src = ./src;
phases = [ "unpackPhase" "installPhase" ];
installPhase = ''
path="$out/tex/latex"
mkdir -p "$path"
cp *.{cls,sty} "$path"
'';
};
in
{
pkgs = builtins.concatLists [
[ rooke-tex ]
texlive.memoir.pkgs
texlive.algorithms.pkgs
texlive.etoolbox.pkgs
texlive.fancyhdr.pkgs
texlive.enumitem.pkgs
texlive.siunitx.pkgs
texlive.algorithmicx.pkgs
texlive.mathtools.pkgs
texlive.amsfonts.pkgs
texlive.amscls.pkgs
texlive.jknapltx.pkgs
texlive.rsfs.pkgs
texlive.pgf.pkgs
texlive.ifetex.pkgs
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment