fix font and literature config

This commit is contained in:
2026-01-25 02:26:40 +01:00
parent a9ed1c0281
commit 878e5c8193
6 changed files with 98 additions and 11 deletions

View File

@@ -4,6 +4,10 @@
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:NixOS/nixpkgs/9da7f1cf7f8a6e2a7cb3001b048546c92a8258b4";
cartograph-cf = {
url = "github:0qln/CartographCF-Nerdfont";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ {
@@ -23,6 +27,10 @@
...
}:
with pkgs.lib; let
fonts = with pkgs; [
ibm-plex
cartographcf-nerdfont
];
latexPackages = with pkgs; [
latexrun
(texlive.withPackages
@@ -31,6 +39,7 @@
amsmath
biber
biblatex
biblatex-ieee
changepage
csquotes
enumitem
@@ -51,9 +60,19 @@
makecell
appendix
apa
csquotes
csquotes-de
]))
];
in {
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
inputs.cartograph-cf.overlays.default
];
config = {};
};
# Per-system attributes can be defined here. The self' and inputs'
# module parameters provide easy access to attributes of the same
# system.
@@ -68,15 +87,24 @@
''
cd .
mkdir -p out
# https://github.com/NixOS/nixpkgs/issues/180639#issuecomment-1178984307
export HOME=$(mktemp -d)
# https://wiki.contextgarden.net/Characters_words_and_fonts/Fonts_in_LuaTeX
mkdir -p .fonts
(cd .fonts && ${concatMapStrings (x: "ln -s ${x} '${x.meta.name}'; ") fonts})
export OSFONTDIR=".fonts"
ls .fonts
build() {
latexmk \
-pdf \
-l -dir-report -file-line-error -verbose \
-interaction=nonstopmode \
"main.tex"
}
build || true
build
'';
installPhase =
@@ -92,7 +120,7 @@
devShells.default = with pkgs;
mkShell {
nativeBuildInputs = [];
nativeBuildInputs = fonts;
packages = [mermaid-cli] ++ latexPackages;
shellHook =