flakey-profile icon indicating copy to clipboard operation
flakey-profile copied to clipboard

default template removes nix from path

Open adrian-gierakowski opened this issue 1 year ago • 3 comments

nix flake init -t github:lf-/flakey-profile#templates.default
nix run .#profile.switch

I end up without nix on PATH without clear path to recover.

Fortunately I ran it in a container :)

Maybe the example should include nix in profile.paths?

adrian-gierakowski avatar Apr 17 '24 11:04 adrian-gierakowski

oh gods. this is because of macOS/possibly others putting nix in /nix/var/nix/profiles/per-user/root instead of /nix/var/nix/profiles/default being a separate profile for root, then running a profile switch command as root on a profile without nix in it. I have no idea why they did this, but it doesn't seem like a good choice on their part.

lf- avatar Apr 17 '24 17:04 lf-

This was in a Linux container (Debian based) with nix installed via https://github.com/DeterminateSystems/nix-installer

note that I was doing this as root

adrian-gierakowski avatar Apr 17 '24 17:04 adrian-gierakowski

For me Nix is in /nix/var/nix/profiles/default/bin/nix on Darwin (via DeterminateSystems/nix-installer).

szlend avatar May 30 '24 18:05 szlend