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

17
flake.lock generated
View File

@@ -1,5 +1,21 @@
{ {
"nodes": { "nodes": {
"fibeamer": {
"flake": false,
"locked": {
"lastModified": 1632472447,
"narHash": "sha256-iITRsfepm6ZnHs7rPKPp4aPhb2Y9PKfR8JcbPvHJiTk=",
"owner": "Witiko",
"repo": "fibeamer",
"rev": "8c1ff9e80a8f7d83239686d8fec520592ace5366",
"type": "github"
},
"original": {
"owner": "Witiko",
"repo": "fibeamer",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
@@ -36,6 +52,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"fibeamer": "fibeamer",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }

View File

@@ -1,54 +1,42 @@
# flake.nix # flake.nix
{ {
description = "LuaLaTeX compilation environment"; description = "LaTeX compilation environment for thesis and beamer presentation";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils"; 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: flake-utils.lib.eachDefaultSystem (system:
let let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
texlive = pkgs.texlive.combine { texlive = pkgs.texlive.combine {
inherit (pkgs.texlive) inherit (pkgs.texlive) scheme-full;
scheme-medium
luatex
latex-bin
latexmk
# Add additional packages as needed:
# amsmath
# fontspec
# unicode-math
# microtype
# geometry
# hyperref
# graphicx
# xcolor
;
}; };
# 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 in
{ {
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
name = "lualatex-env"; name = "latex-env";
buildInputs = [ buildInputs = [
texlive texlive
pkgs.lua5_3 pkgs.biber
]; ];
shellHook = '' shellHook = ''
echo "LuaLaTeX environment loaded" export TEXMFHOME="${fibeamerTexmf}:"
echo "Available: lualatex, latexmk, luatex" echo "LaTeX environment loaded (pdflatex + biber + fibeamer)"
lualatex --version | head -1 pdflatex --version | head -1
''; '';
}; };
# App for direct compilation
apps.default = {
type = "app";
program = "${texlive}/bin/lualatex";
};
}); });
} }