Skip to content

Commit

Permalink
Add troubleshooting entry for Nix issue on macOS (#1075)
Browse files Browse the repository at this point in the history
* Add troubleshooting entry for broken Nix on macOS updates
  • Loading branch information
wamirez authored Nov 7, 2024
1 parent ac38abe commit 7accda1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions source/guides/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,17 @@ $ nix-store --load-db < /tmp/db.dump
This may mean you are trying to import a too large file or directory into the [Nix store](https://nix.dev/manual/nix/stable/glossary#gloss-store), or your machine is running out of resources, such as disk space or memory.

Try to reduce the size of the directory to import, or run [garbage collection](https://nix.dev/manual/nix/stable/command-ref/nix-collect-garbage).

## macOS update breaks Nix installation

This is a [known issue](https://github.com/NixOS/nix/issues/3616).
The [Nix installer](https://nix.dev/manual/nix/latest/installation/installing-binary) modifies `/etc/zshrc`.
When macOS is updated, it will typically overwrite `/etc/zshrc` again.

As a workaround, add the following code snippet to the end of `/etc/zshrc` and restart the shell:

```bash
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
```

0 comments on commit 7accda1

Please sign in to comment.