Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken symbolic links in /nix/var/nix/gcroots/per-user/ are not garbage collected #7166

Open
dschrempf opened this issue Oct 13, 2022 · 1 comment
Labels

Comments

@dschrempf
Copy link
Contributor

Describe the bug
Broken symbolic links in /nix/var/nix/gcroots/per-user/ are not garbage collected. However, broken symbolic links in /nix/var/nix/gcroots/auto/ are garbage collected. This behavior is not consistent, but it might be intentional. Is that so? If so, why? If not, can we also collect broken symbolic links in the per-user directory?

Steps To Reproduce
The problem arose due to excessive usage of nix-direnv, which creates symbolic links in the per-user category. When nix-direnv profiles are changed, new links are created, and the old ones become broken.

Expected behavior
I do not know what the expected behavior is in general. In my use case, I expected the garbage collector to also collect the symbolic links in the per-user directory.

nix-env --version output
nix-env (Nix) 2.11.0

Additional context
See a corresponding issue at nix-direnv: nix-community/nix-direnv#242.

@dschrempf dschrempf added the bug label Oct 13, 2022
@Congee
Copy link

Congee commented Dec 23, 2022

And this command find -L /nix/var/nix/gcroots/per-user/$USER -maxdepth 1 -type l -delete to delete them for those who have OCD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants