I updated to nixos 24.11 yesterday.
When I work within a direnv (version 2.23.3) calls to mktemp fail with an error since the $TEMPDIR variable is not correcly set.
Reproduction:
Create a dir with with a minimal shell.nix like
{pkgs ? import <nixpkgs> {} }:
pkgs.mkShellNoCC{}
enable direnv:
echo "use_nix"> .envrc
direnv allow
and run nix-shell
.
Expected behavior:
nix shell is created.
Observed behavior:
I get an error like:
error: creating directory '/tmp/nix-shell-194386-0/nix-shell-196284-0': No such file or directory
I figured that this comes from the direnv call to mktemp
which fails with a similar error when called directly.
within the direnv the $TEMPDIR
is set to /tmp/nix-shell-XXXXXXXX/
while not being set outside the direnv.
- Does anybody has an Idea where this change in behaviour could originate from?
- How can I fix that calls to mktemp don’t fail within a direnv (it breaks cmake for me in some directories as well)