LnL7 / nix-darwin

nix modules for darwin
MIT License
3.05k stars 442 forks source link

darwin-rebuild switch stuck on "waiting for nix-daemon" #343

Open peterstuart opened 3 years ago

peterstuart commented 3 years ago

When I run darwin-rebuild switch, it loops forever on "waiting for nix-daemon":

building the system configuration...
user defaults...
setting up user launchd services...
setting up ~/Applications...
applying patches...
setting up /etc...
system defaults...
setting up launchd services...
waiting for nix-daemon
waiting for nix-daemon
waiting for nix-daemon
waiting for nix-daemon
waiting for nix-daemon
waiting for nix-daemon
...

I see that this is happening here: https://github.com/LnL7/nix-darwin/blob/a7492a8c76dcc702d0a65cd820a5f9baa8702684/modules/nix/default.nix#L481 but I'm not familiar enough with nix to understand the purpose of that code.

If I try to run something similar manually using the path of pkgs.stdenv.shell:

nix repl '<nixpkgs>'

nix-repl> pkgs.stdenv.shell
"/nix/store/wlikhqcspmv8x9sb3gsczj5fqbqcbxw2-bash-4.4-p23/bin/bash"

I get this output:

nix-store --store daemon -q --hash /nix/store/wlikhqcspmv8x9sb3gsczj5fqbqcbxw2-bash-4.4-p23/bin/bash
# sha256:0w5lvc1lm6h6hizpgbpn2935d9ywhqbc7s0k6ic30yw6d58n714z

Any idea what is going wrong here? I'm seeing the issue on 2 Macs.

bohendo commented 1 year ago

I just encountered this. It went away when I changed:

  nix.settings.allowed-users = [ "bohendo" ];
  nix.settings.trusted-users = [ "bohendo" ];

to

  nix.settings.allowed-users = [ "root" "bohendo" ];
  nix.settings.trusted-users = [ "root" "bohendo" ];

in my configuration.nix

jedahu commented 1 year ago

On my machine this appears to be related to https://github.com/NixOS/nixpkgs/issues/241559.

$ nix-store --store daemon -q --hash /nix/store/nzzzgjcc8568iyyja0vvv840hnka6l37-bash-5.2-p15/bin/bash
dyld[15372]: missing symbol called
Abort trap: 6
zdcthomas commented 5 months ago

I'm seeing this same error, but adding "root" didn't seem to fix it. I'm wondering if anyone else has any other ideas