nix-darwin icon indicating copy to clipboard operation
nix-darwin copied to clipboard

Nix-Darwin x HM doesn't install paths in for zsh `/run/current-system/sw/bin`

Open Eveeifyeve opened this issue 4 months ago • 12 comments

The issue is when I install nix on my machine m2 Macbook pro 13inch it some how doesn't have this path exported which I need for darwin-rebuild for some reason only nix run nix-darwin -- switch --flake ~/.dotfiles/ seems to work.

PATH Echo Output

/Users/eveeifyeve/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/bin:/bin

List /run/current-system/sw/bin

bash			darwin-option		info			nix-build		nix-daemon		nix-instantiate		pdftexi2dvi		texi2dvi
bashbug			darwin-rebuild		install-info		nix-channel		nix-env			nix-prefetch-url	pod2texi		texi2pdf
brew			darwin-uninstaller	makeinfo		nix-collect-garbage	nix-hash		nix-shell		sh			texindex
darwin-help		darwin-version		nix			nix-copy-closure	nix-info		nix-store		texi2any

Info

  • Nix: 2.21.1
  • MacOS: Sonoma 14.4
  • M2 Macbook pro 13inch with 8 gb of memory
  • Nix Config: https://github.com/Eveeifyeve/Dotfiles

Eveeifyeve avatar Apr 04 '24 13:04 Eveeifyeve

I have tried both the distributed systems and nixos.org nix and still not working so it's not a nix problem.

Eveeifyeve avatar Apr 04 '24 13:04 Eveeifyeve

If you add programs.zsh.enable = true; does that fix it?

Enzime avatar Apr 05 '24 02:04 Enzime

same here I have set programs.fish.enable = true;, but there is no in$PATH

 ~  echo $PATH                                                  21.3s  Sat Apr  6 03:34:06 2024
/nix/var/nix/profiles/default/bin /opt/homebrew/bin /usr/local/bin /System/Cryptexes/App/usr/bin /usr/bin /bin /usr/sbin /sbin /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin

yswtrue avatar Apr 05 '24 19:04 yswtrue

If i add the programs.enabled.zsh it still doesn't work.

Eveeifyeve avatar Apr 05 '24 22:04 Eveeifyeve

I have discussed in both distributed systems and nix discord and told me it's a nix-darwin issue.

Eveeifyeve avatar Apr 05 '24 22:04 Eveeifyeve

finally I install fish from nix-darwin

        environment.shells = [ pkgs.bashInteractive pkgs.zsh pkgs.fish ];

and then chsh to /run/current-system/sw/bin/fish than reboot fix this error, seams fish from brew can't read nix relate config

yswtrue avatar Apr 06 '24 12:04 yswtrue

I have tried a new fresh install of nix and removed all of the volumes and stuff and path is still not added I am going to try the enable zsh method.

Eveeifyeve avatar Apr 07 '24 10:04 Eveeifyeve

Okay It turns out I have to enable it with nix-darwin not hw.

I will make a pr that warns people about this.

Eveeifyeve avatar Apr 07 '24 11:04 Eveeifyeve

Thank you @Eveeifyeve I was trying to debug this since a long time and found your comment. Now my path contains /run/current-system/sw/bin.

ibizaman avatar Apr 15 '24 18:04 ibizaman

Looks like this issue is due to https://github.com/nix-community/home-manager/issues/2751

ibizaman avatar Apr 15 '24 19:04 ibizaman

Hey I want to do a check for one of the shell is enabled but I want ask where exactly the check be located? The check is for people who don't enabled any shell and that way it errors out if you haven't enabled it.

It will maybe close: #922 #122 #158. There maybe more that I don't know if there is reply to this with the #.

Eveeifyeve avatar Apr 18 '24 02:04 Eveeifyeve

I also have the same problem.

stringang avatar Apr 24 '24 09:04 stringang