This problem was reported in issue #6007 (currently closed). The solution given involves the concept of “sandboxes” and seems to apply to share environments. I am simply creating ad hoc environments for a single user.
I started using Nix a few weeks ago and if at first this wasn’t much of a problem, as the environments I need require larger number of packages I am hitting it all the time. Any environment with more than 3 or 4 packages usually fails with this error.
I already increased the limit to open files, but the issue remains. Sounds like some sort of “leak” is at play.
$ ulimit -u
62155
$ ulimit -n
2048
Any strategies to work around this problem? Thank you.
Update: This problem is prevalent with the latest unstable release:
$ nix --version
nix (Nix) 2.25.0pre20240807_cfe66dbe
$ nix-shell -p pandoc haskellPackages.pandoc-crossref pandoc-include librsvg texliveFull
[...]
error: creating pipe: Too many open files