Advertisement
Guest User

flake.nix

a guest
Jan 14th, 2022
17
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2. description = "LaTeX Document Demo";
  3. inputs = {
  4. nixpkgs.url = github:NixOS/nixpkgs/nixos-21.05;
  5. flake-utils.url = github:numtide/flake-utils;
  6. };
  7. outputs = { self, nixpkgs, flake-utils }:
  8. with flake-utils.lib; eachSystem allSystems (system:
  9. let
  10. #pkgs = nixpkgs.legacyPackages.${system};
  11. pkgs = import nixpkgs {
  12. inherit system;
  13. overlays = [
  14. (final: prev: {
  15. texlive.tufte-latex = prev.texlive.tufte-latex.overrideAttrs (old: {
  16. patches = (old.patches or [ ]) ++ [ ./texmf/tex/latex/tufte.nofonts.patch ];
  17. });
  18. })
  19. ];
  20. };
  21. tex = pkgs.texlive.combine {
  22. inherit (pkgs.texlive) latex-bin latexmk scheme-basic pgf pgfopts pgfplots
  23. algorithmicx algorithms float biblatex biber titlesec tcolorbox environ
  24. enumitem xsim translations booktabs tasks ulem needspace xpatch microtype ebgaramond
  25. xkeyval fontspec eulervm lettrine minifp marginnote mathtools siunitx
  26. tabstackengine stackengine minitoc nomencl csquotes cleveref tabu thmtools fmtcount
  27. hardwrap catchfile ragged2e everysel textcase setspace tufte-latex caption babel-german
  28. subfig optidef tabto-ltx
  29. ;
  30. };
  31. in
  32. rec {
  33. packages = {
  34. document = pkgs.stdenvNoCC.mkDerivation rec {
  35. name = "latex-demo-document";
  36. src = self;
  37. buildInputs = [ pkgs.coreutils tex ];
  38. phases = [ "unpackPhase" "buildPhase" "installPhase" ];
  39. buildPhase = ''
  40. export PATH="${pkgs.lib.makeBinPath buildInputs}";
  41. mkdir -p .cache/texmf-var
  42. env TEXMFHOME=.cache:texmf TEXMFVAR=.cache/texmf-var \
  43. SOURCE_DATE_EPOCH=$(date -d "2021-11-30" +%s) \
  44. lualatex -pdf document.tex
  45. '';
  46. installPhase = ''
  47. mkdir -p $out
  48. cp document.pdf $out/
  49. '';
  50. };
  51. };
  52. defaultPackage = packages.document;
  53. });
  54. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement