Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- description = "LaTeX Document Demo";
- inputs = {
- nixpkgs.url = github:NixOS/nixpkgs/nixos-21.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};
- pkgs = import nixpkgs {
- inherit system;
- overlays = [
- (final: prev: {
- texlive.tufte-latex = prev.texlive.tufte-latex.overrideAttrs (old: {
- patches = (old.patches or [ ]) ++ [ ./texmf/tex/latex/tufte.nofonts.patch ];
- });
- })
- ];
- };
- tex = pkgs.texlive.combine {
- inherit (pkgs.texlive) latex-bin latexmk scheme-basic pgf pgfopts pgfplots
- algorithmicx algorithms float biblatex biber titlesec tcolorbox environ
- enumitem xsim translations booktabs tasks ulem needspace xpatch microtype ebgaramond
- xkeyval fontspec eulervm lettrine minifp marginnote mathtools siunitx
- tabstackengine stackengine minitoc nomencl csquotes cleveref tabu thmtools fmtcount
- hardwrap catchfile ragged2e everysel textcase setspace tufte-latex caption babel-german
- subfig optidef tabto-ltx
- ;
- };
- 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:texmf TEXMFVAR=.cache/texmf-var \
- SOURCE_DATE_EPOCH=$(date -d "2021-11-30" +%s) \
- lualatex -pdf document.tex
- '';
- installPhase = ''
- mkdir -p $out
- cp document.pdf $out/
- '';
- };
- };
- defaultPackage = packages.document;
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement