38 lines
1.2 KiB
Nix
38 lines
1.2 KiB
Nix
|
{
|
||
|
description = "Summary of the course AI1";
|
||
|
inputs = {
|
||
|
nixpkgs.url = github:NixOS/nixpkgs/nixos-24.11;
|
||
|
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.texliveFull;
|
||
|
# pkgs.texlive.combine {
|
||
|
# inherit (pkgs.texlive) scheme-minimal latex-bin latexmk;
|
||
|
# };
|
||
|
in rec {
|
||
|
packages = {
|
||
|
document = pkgs.stdenvNoCC.mkDerivation rec {
|
||
|
name = "summary";
|
||
|
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 \
|
||
|
SOURCE_DATE_EPOCH=${toString self.lastModified} \
|
||
|
latexmk -pdf -xelatex -shell-escape -file-line-error -synctex=1 -halt-on-error -shell-escape \
|
||
|
main.tex
|
||
|
'';
|
||
|
installPhase = ''
|
||
|
mkdir -p $out
|
||
|
cp main.pdf $out/
|
||
|
'';
|
||
|
};
|
||
|
};
|
||
|
defaultPackage = packages.document;
|
||
|
});
|
||
|
}
|