[Nix-dev] Nix profiles

Vladimír Čunát vcunat at gmail.com
Tue Oct 30 22:23:25 CET 2012


On 10/30/2012 09:50 PM, Richard Wallace wrote:
> I would have tried that, but after switching to a new profile none of
> the nix commands were available.  I installed using the generic x86_64
> tarball, which apparently means that they are installed in the nix
> store.  So when I switched to a non existent profile, I no longer had
> access to them.

The only thing "nix-env -S <path>" does is symlinking ~/.nix-profile to 
<path>. We do that to make even all running applications use the new 
paths on any further file-opens (~/.nix-profile/bin is in $PATH, etc.). 
This is designed for the all-purpose working environment for the user; 
on NixOS is there's also the /run/current-system/sw/ profile for 
whole-system stuff.

For project environments I suppose you should use nix-env -p 
/nix/var/nix/profiles/per-user/$USER/$project1 and then always add this 
one in the shell you use (probably you'll shorten it into some symlink 
from your project). Note that all these profile paths are again just 
symlinks to the current generation of the profile, like 
/nix/var/nix/profiles/per-user/$USER/$project1-123-link in this case, so 
they can be switched on update.

I hope it's clear now.

Vlada

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3251 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20121030/f61604fa/attachment.bin 


More information about the nix-dev mailing list