[Nix-dev] nix-env and locking

Eelco Dolstra e.dolstra at tudelft.nl
Wed Jul 8 11:13:50 CEST 2009


Hi,

Nathaniel Griswold wrote:

> What is the proper way to allow users to create their own profiles in
> gc-managed locations?
> 
> I tried a simple root-run nix-worker setup, but nix-env is still
> complaining about access to /nix/var/nix/profiles. Does locking not go
> through the daemon, and if so is this intentional?

Yes.  You need write access to the directory containing the profile you're
changing.  This is why in NixOS every user has his own profile directory
(/nix/var/nix/profiles/per-user/$USER).  So you could do something like

(as root)
$ mkdir /nix/var/nix/profiles/my-profiles
$ chown ...me... /nix/var/nix/profiles/my-profiles
(as the normal user)
$ nix-env --switch-profile /nix/var/nix/profiles/my-profiles/default

-- 
Eelco Dolstra | http://www.st.ewi.tudelft.nl/~dolstra/



More information about the nix-dev mailing list