Eason0210 / system

Declarative system configurations using nixOS, nix-darwin, and home-manager
MIT License
2 stars 0 forks source link

"Too many open files" on macOS #18

Closed Eason0210 closed 2 years ago

Eason0210 commented 2 years ago

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.

Possibly related: NixOS/nixpkgs#101459

Eason0210 commented 2 years ago

Fixed in a5d8b9 Don't use Nix to manage Emacs packages