Bootstrap a new nix-darwin system will trigger the "Too many open files" error.
> nix --extra-experimental-features "nix-command flakes" develop -c sysdo bootstrap --darwin MacBook
...
copying path '/nix/store/ysksbgcp0lcys2dvishnf6c6v7n9i3gz-DarwinTools-1' from 'https://cache.nixos.org'...
downloading 'https://cache.nixos.org/nar/0shapm441yf1j36xpr672cayarc8z546r1l36g0barm2mq76ysik.nar.xz'...
error: opening directory '/nix/store/5ksliqgjb84cws7sknzvwlflw257ajfb-source': Too many open files
> ./result/sw/bin/darwin-rebuild switch --flake .#MacBook
sh: ./result/sw/bin/darwin-rebuild: No such file or directory
MacBook% pwd
/Users/aqua0210/.nixpkgs
MacBook% ls
LICENSE.md bin flake.lock lib profiles shell.nix README.md docs flake.nix modules result treefmt.toml
MacBook% ls ./result/sw/bin/
ls: ./result/sw/bin/: No such file or directory
MacBook% ls ./result/sw/
ls: ./result/sw/: No such file or directory
MacBook% nix --version
nix (Nix) 2.4
Work around:
Remove emacs.nix in ./modules/home-manager will fix this issue, after bootstrap, add emacs.nix again and activate system by sysdo switch MacBook will work as normal.
Bootstrap a new nix-darwin system will trigger the "Too many open files" error.
Work around: Remove
emacs.nix
in ./modules/home-manager will fix this issue, after bootstrap, addemacs.nix
again and activate system bysysdo switch MacBook
will work as normal.Possibly related: NixOS/nixpkgs#101459