You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
nix profile add leaves its temporary profile tree in TMPDIR after success #16809
nix profile add (install) leaves its temporary profile-building directory in $TMPDIR after it exits successfully. Each run leaves one nix-<pid>-<random> directory, which holds the profile's whole symlink tree and manifest.json.
For a desktop profile (Home Manager's installPackages step runs nix profile install), one leftover tree holds about 1.1 million entries; icon themes account for most of them. On a host whose /tmp is on the root filesystem, 79 such directories accumulated over a few weeks, about 26 million inodes in all. That exhausted the root's inodes, and later activations failed with No space left on device while creating symlinks.
Steps To Reproduce
mkdir -p /tmp/leak/tmp
TMPDIR=/tmp/leak/tmp nix profile add --profile /tmp/leak/prof "$(nix build --no-link --print-out-paths nixpkgs#jq.bin)"echo"exit=$?"# exit=0
find /tmp/leak/tmp # nix-<pid>-<random>/manifest.json and bin/ remain
TMPDIR=/tmp/leak/tmp nix profile add --profile /tmp/leak/prof "$(nix build --no-link --print-out-paths nixpkgs#htop)"
find /tmp/leak/tmp # a second nix-<pid>-<random>/ remains beside the first
Expected behavior
The temporary directory is removed when the command finishes, as it is once its contents have been added to the store.
Activity