lf- / flakey-profile

Declarative profiles with nix flakes
63 stars 2 forks source link

default template removes nix from path #1

Open adrian-gierakowski opened 5 months ago

adrian-gierakowski commented 5 months ago
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?

lf- commented 5 months ago

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.

adrian-gierakowski commented 5 months ago

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

szlend commented 4 months ago

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