With latex installed through the nix package manager (on nixos), \today always expands to December 31st, 1979 instead of the current date. How can I get this to give return the correct date? Files corrected with nix build users have modification times of that date too so is this related?
MWE
Create a directory and add the mwe.tex and flake.nix (based off Exploring Nix Flakes: Build LaTeX Documents Reproducibly).
β mwe.tex β
\documentclass[11pt]{article}
\title{}
\date{\today}
\begin{document}
\maketitle
\end{document}
β mwe.tex ends here β
β flake.nix β
{
description = "MWE for reproducing \\today macro problem";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
tex = pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-minimal latex-bin latexmk;
};
in rec {
packages = {
document = pkgs.stdenvNoCC.mkDerivation rec {
name = "mwe";
src = self;
buildInputs = [ pkgs.coreutils tex ];
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
buildPhase = ''
export PATH="${pkgs.lib.makeBinPath buildInputs}";
mkdir -p .cache/texmf-var
env TEXMFHOME=.cache TEXMFVAR=.cache/texmf-var \
latexmk -pdf -lualatex mwe.tex
'';
installPhase = ''
mkdir -p $out
cp mwe.pdf $out/
'';
};
};
defaultPackage = packages.document;
});
}
β flake.nix ends here β
Then run nix build "."
in the new directory. The results should be a pdf containing December 31, 1979 (or when I just ran this I actually got January 1, 1980). I get the same problem when running latexmk
as myself at the command line so itβs not only when the file is compiled by a nix build user.j