error: opening directory ‘/nix/store/q46wma6hwg6dz6r35dksrqzin0b6f4ba-crate-indexmap-1.7.0.tar.gz’: Too many open files
i’ve got a few questions on the context for this error message.
which command did you use that lead to this error?
what architecture does your system have?
also, did you set up cachix before running the
nix-shell? if not, this command should do the trick:
nix run -f https://cachix.org/api/v1/install cachix -c cachix use holochain-ci
If you got a Mac Book with a M1 Chipset this may be helpful → Setup on macbook with m1 chip - #5 by lucksus
i’d like to take the relevant parts of @lucksus’ messages to this thread as well.
This is what @kaichao suggested and made it work for me:
sudo launchctl limit maxfiles 1024 unlimited sudo launchctl stop org.nixos.nix-daemon
if i understand this correctly the first command sets the maxfiles hardlimit systemwide to unlimited, which i found to mean 10240. IMO this poses a security risk.
the second command stops the nix-daemon. i assume this causes the nix-daemon to be started again on demand on the next invocation of any nix program. i assume the nix-daemon now adopts the new system’s limits.
IMO the first command isn’t ideal and would ideally replaced by a command that removes this limitation for the nix-daemon service only, as opposed to the whole system. i don’t know how to do this and maybe someone more familiar with macOS does. until then, i will try to find out and will inform this thread if i find something
this has been resolved upstream just a few days ago:
the commit hasn’t made it into any release as of now. it should be possible to make these changes to the service file directly. i don’t have nix-daemon running on my macOS VM, but it should be possible to identify the file in question with this command
sudo find / -name org.nixos.nix-daemon.plist
and then add the changes given in the commit and restart the service with the command @lucksus gave above.
that’s all i have for now