Bandwidth freeze

This commit is contained in:
2026-09-09 12:07:01 +03:00
parent 74a70c2c63
commit 33d55169ef
5 changed files with 580 additions and 42 deletions
+46 -37
View File
@@ -55,6 +55,49 @@
fontsConf = pkgs.makeFontsConf {
fontDirectories = [ pkgs.culmus ];
};
thesisBuildInputs = [
pkgs.coreutils
pkgs.fontconfig
(pkgs.texlive.combine texPkgs)
pkgs.culmus
];
mkThesisDoc = { name, texFile }:
let pdfFile = builtins.replaceStrings [ ".tex" ] [ ".pdf" ] texFile;
in pkgs.stdenvNoCC.mkDerivation {
inherit name;
src = self;
buildInputs = thesisBuildInputs;
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
buildPhase = ''
export PATH="${pkgs.lib.makeBinPath thesisBuildInputs}";
mkdir -p .cache/texmf-var .cache/fontconfig
# Build a fontconfig pointing at culmus with a writable cache
FCACHE="$(pwd)/.cache/fontconfig"
cat > .cache/fonts.conf <<EOF
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<dir>${pkgs.culmus}/share/fonts/truetype</dir>
<cachedir>$FCACHE</cachedir>
</fontconfig>
EOF
export FONTCONFIG_FILE="$(pwd)/.cache/fonts.conf"
export FONTCONFIG_CACHE="$FCACHE"
fc-cache -f 2>/dev/null || true
env TEXMFHOME=.cache TEXMFVAR=.cache/texmf-var \
latexmk -xelatex -f --interaction=nonstopmode \
${texFile} || true
test -f ${pdfFile}
'';
installPhase = ''
mkdir -p $out
cp ${pdfFile} $out/
'';
};
in
{
devShells.${system}.default = pkgs.mkShell {
@@ -70,43 +113,9 @@
'';
};
packages.${system}.default = pkgs.stdenvNoCC.mkDerivation rec {
name = "roll-thesis";
src = self;
buildInputs = [
pkgs.coreutils
pkgs.fontconfig
(pkgs.texlive.combine texPkgs)
pkgs.culmus
];
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
buildPhase = ''
export PATH="${pkgs.lib.makeBinPath buildInputs}";
mkdir -p .cache/texmf-var .cache/fontconfig
# Build a fontconfig pointing at culmus with a writable cache
FCACHE="$(pwd)/.cache/fontconfig"
cat > .cache/fonts.conf <<EOF
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<dir>${pkgs.culmus}/share/fonts/truetype</dir>
<cachedir>$FCACHE</cachedir>
</fontconfig>
EOF
export FONTCONFIG_FILE="$(pwd)/.cache/fonts.conf"
export FONTCONFIG_CACHE="$FCACHE"
fc-cache -f 2>/dev/null || true
env TEXMFHOME=.cache TEXMFVAR=.cache/texmf-var \
latexmk -xelatex -f --interaction=nonstopmode \
main.tex || true
test -f main.pdf
'';
installPhase = ''
mkdir -p $out
cp main.pdf $out/
'';
packages.${system} = {
default = mkThesisDoc { name = "roll-thesis"; texFile = "main.tex"; };
mentor = mkThesisDoc { name = "roll-thesis-mentor"; texFile = "mentor.tex"; };
};
};
}