title: Latex \today macro expanding to December 31st, 1979
body: <p>With latex installed through the nix package manager (on nixos), \today always expands to December 31st, 1979. How do I get this to return the correct date?</p>
  <p><strong>MWE</strong>
  Create a directory and add the mwe.tex and flake.nix (based off <a href="https://flyx.org/nix-flakes-latex/" rel="nofollow noreferrer">https://flyx.org/nix-flakes-latex/</a>).</p>
  <p>-- mwe.tex --</p>
  <pre><code>\documentclass[11pt]{article}
  
  \title{}
  \date{\today}
  
  \begin{document}
  \maketitle
  \end{document}
  </code></pre>
  <p>-- mwe.tex ends here --</p>
  <p>-- flake.nix --</p>
  <pre><code>{
    description = &quot;MWE for reproducing \\today macro problem&quot;;
  
    inputs = {
      nixpkgs.url = &quot;github:NixOS/nixpkgs&quot;;
      flake-utils.url = &quot;github:numtide/flake-utils&quot;;
    };
  
    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 = &quot;mwe&quot;;
              src = self;
              buildInputs = [ pkgs.coreutils tex ];
              phases = [ &quot;unpackPhase&quot; &quot;buildPhase&quot; &quot;installPhase&quot; ];
              buildPhase = ''
                export PATH=&quot;${pkgs.lib.makeBinPath buildInputs}&quot;;
                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;
        });
  }
  </code></pre>
  <p>-- flake.nix ends here --</p>
  <p>Then run <code>nix build &quot;.&quot;</code> 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).</p>