Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use nix-env from a user account #5713

Closed
Profpatsch opened this issue Jan 11, 2015 · 8 comments
Closed

Cannot use nix-env from a user account #5713

Profpatsch opened this issue Jan 11, 2015 · 8 comments

Comments

@Profpatsch
Copy link
Member

All of this is with mutableUsers = false:

The following error is thrown:

error: Nix database directory ‘/nix/var/nix/db’ is not writable: Permission denied

It works, once I manually set

export NIX_REMOTE=daemon

So this probably needs to be set somewhere.

@lucabrunox
Copy link
Contributor

You are probably using a shell that does not honor /etc/profile.

On Sun, Jan 11, 2015 at 8:10 PM, Profpatsch notifications@github.com
wrote:

All of this is with mutableUsers = false:

The following error is thrown:

error: Nix database directory ‘/nix/var/nix/db’ is not writable: Permission denied

It works, once I manually set

export NIX_REMOTE=daemon

So this probably needs to be set somewhere.


Reply to this email directly or view it on GitHub
#5713.

NixOS Linux http://nixos.org

@Profpatsch
Copy link
Member Author

Indeed, zsh does not load /etc/profile by default, but it does /etc/zprofile.

What would be the sensible way to go? Link profile to zprofile when installing the zsh package?

@vcunat
Copy link
Member

vcunat commented Jan 11, 2015

I think the overall level of support for non-bash shells (as the default user shell) is rather low ATM.

@ttuegel
Copy link
Member

ttuegel commented Jan 12, 2015

If you are on NixOS, you must set programs.zsh.enable = true to generate the correct profile for zsh. The overall level of support for non-bash shells is poor, but I made sure for myself that zsh is working :)

@Profpatsch
Copy link
Member Author

@ttuegel Ah, thx!

@alexeymuranov
Copy link
Contributor

alexeymuranov commented Mar 30, 2018

After upgrading to the pre-release version of 18.03, i've got a similar issue in bash, but with nix-repl instead of nix-env. Using export NIX_REMOTE=daemon helped... How can i fix this?

@wmertens
Copy link
Contributor

wmertens commented Jul 28, 2018

EDIT: Hmm, I had nix installed by default as root via nix-env. Removing it fixed that.

Experiencing the same, upgraded to 18.03 and nix-env doesn't work until I set NIX_REMOTE. Somehow the default profile didn't get a v2 nix

lrwxrwxrwx 1 root root 66 Jan  1  1970 /nix/var/nix/profiles/default/bin/nix-env -> /nix/store/hb61in5qxb0a0nfkf9hqa0449vg1lkc5-nix-1.11.8/bin/nix-env

@alexeymuranov
Copy link
Contributor

Concerning nix-repl, it turned out it was enough to use nix repl instead (and uninstall nix-repl).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants