Add package to flake

This commit is contained in:
Pedro Rey Anca 2025-09-07 23:59:47 +02:00
parent 5d4ec980a2
commit 0b4930574b
Signed by: peprolinbot
GPG key ID: 053EA6E00116533A
2 changed files with 54 additions and 9 deletions

4
.gitignore vendored
View file

@ -320,3 +320,7 @@ TSWLatexianTemp*
### lualatex ###
luatex.*/
### Nix ###
result
result/

View file

@ -5,15 +5,56 @@ description = "LaTeX Beamer Presentation for GPUL Schools: Software Libre";
flake-utils.url = github:numtide/flake-utils;
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system}; in
{
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = nixpkgs.legacyPackages.${system};
tex = pkgs.texlive.combine {
inherit
(pkgs.texlive)
scheme-basic
latex-bin
latexmk
collection-langspanish
beamer
biblatex
biber
csquotes
emoji
fontspec
noto-emoji
;
};
# tex = pkgs.texliveFull;
in rec {
packages = {
document = pkgs.stdenvNoCC.mkDerivation rec {
name = "latex-beamer-gpul-schools-software-libre";
src = self;
buildInputs = [pkgs.coreutils tex];
phases = ["unpackPhase" "buildPhase" "installPhase"];
buildPhase = ''
export PATH="${pkgs.lib.makeBinPath buildInputs}";
env TEXMFVAR=$(mktemp -d) \
SOURCE_DATE_EPOCH=${toString self.lastModified} \
latexmk -interaction=nonstopmode -pdf -lualatex \
-pretex="\pdfvariable suppressoptionalinfo 512\relax" \
-usepretex main.tex
'';
installPhase = ''
mkdir -p $out
cp main.pdf $out/
'';
};
};
defaultPackage = packages.document;
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
texstudio
texlive.combined.scheme-full
];
buildInputs = packages.document.buildInputs;
};
}
);