{ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; }; outputs = { self, nixpkgs, ... }: let forAllSystems = f: (nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system: let pkgs = import nixpkgs { inherit system; }; in f { inherit pkgs system; } )); in { packages = forAllSystems ({ pkgs, system, ...}: rec { cletex2 = pkgs.stdenvNoCC.mkDerivation { pname = "cletex2"; version = "0.0.0"; outputs = [ "out" "tex" ]; # Only include files that are required for the LaTeX # package so we avoid unnecassary TeX env rebuilds on # changing other parts of the repo like the Nix # infrastructure src = pkgs.lib.sources.sourceByRegex ./. [ "^build.lua$" "^tex/.*$" ]; nativeBuildInputs = with pkgs; [ (texlive.withPackages (ps: with ps; [ l3build ])) ]; unpackPhase = ""; dontConfigure = true; buildPhase = '' ''; installPhase = '' mkdir $out mkdir $tex TEXMFHOME=$tex l3build install ''; }; cletex2-env = pkgs.texlive.withPackages (ps: with ps; [ cletex2 collection-langgerman collection-latex collection-luatex koma-script latexmk ]); cletex2mk = pkgs.writeShellApplication { name = "cletex2mk"; runtimeInputs = [ self.packages.${system}.cletex2-env ]; text = '' latexmk -lualatex -interaction=nonstopmode "$@" ''; }; }); hydraJobs = { inherit (self) packages; }; }; }