nix flake for lualatex 2

This commit is contained in:
Priec
2026-02-25 09:44:12 +01:00
parent 02db8fc661
commit caedb5917b
2 changed files with 35 additions and 30 deletions

View File

@@ -1,54 +1,42 @@
# flake.nix
{
description = "LuaLaTeX compilation environment";
description = "LaTeX compilation environment for thesis and beamer presentation";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
fibeamer = {
url = "github:Witiko/fibeamer";
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils }:
outputs = { self, nixpkgs, flake-utils, fibeamer }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
texlive = pkgs.texlive.combine {
inherit (pkgs.texlive)
scheme-medium
luatex
latex-bin
latexmk
# Add additional packages as needed:
# amsmath
# fontspec
# unicode-math
# microtype
# geometry
# hyperref
# graphicx
# xcolor
;
inherit (pkgs.texlive) scheme-full;
};
# Build a TEXMF tree for fibeamer so LaTeX can find it
fibeamerTexmf = pkgs.runCommand "fibeamer-texmf" {} ''
mkdir -p $out/tex/latex/fibeamer
cp -r ${fibeamer}/* $out/tex/latex/fibeamer/
'';
in
{
devShells.default = pkgs.mkShell {
name = "lualatex-env";
name = "latex-env";
buildInputs = [
texlive
pkgs.lua5_3
pkgs.biber
];
shellHook = ''
echo "LuaLaTeX environment loaded"
echo "Available: lualatex, latexmk, luatex"
lualatex --version | head -1
export TEXMFHOME="${fibeamerTexmf}:"
echo "LaTeX environment loaded (pdflatex + biber + fibeamer)"
pdflatex --version | head -1
'';
};
# App for direct compilation
apps.default = {
type = "app";
program = "${texlive}/bin/lualatex";
};
});
}