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

darwin-rebuild requires empty NIX_REMOTE variable and /etc/static/* no longer updating #17

Closed
bkase opened this issue Mar 5, 2017 · 5 comments

Comments

@bkase
Copy link
Contributor

bkase commented Mar 5, 2017

I'm not sure what I did with my installation, but whenever I darwin-rebuild {switch|build} I now need to set NIX_REMOTE= or else I get the following error:

building the system configuration...
error: couldn't change to directory of ‘/nix/var/nix/daemon-socket/socket’: No such file or directory
(use ‘--show-trace’ to show detailed location information)

(the trace is not useful)

I don't know if this is related to the problem I'm seeing now where /etc/static no longer updates after a rebuild. I'll dig into this further and try to debug it myself, but was wondering if something about how my configuration is broken is obvious to you.

@LnL7
Copy link
Owner

LnL7 commented Mar 5, 2017

Did you enable the nix-daemon? I assume this is because it's set to daemon

@LnL7
Copy link
Owner

LnL7 commented Mar 5, 2017

You can look at /run/current-system/activate and run it inside nix-shell -p stdenv to reactivate your current system. Note that that you have to start a new terminal (and restart tmux/screen) for changes like environment variables to propagate to your shell.

@bkase
Copy link
Contributor Author

bkase commented Mar 5, 2017

Re the daemon:
Ahh, I did enable it out of curiosity from looking at your example config. It didn't seem to work though (do I need to manually create a nixbld group?), so I did remove it from my config. I guess not having the nix-daemon enabled doesn't unset the NIX_REMOTE variable?

The bug with /etc/static not updating:
ln -sfn /nix/store/m0rm1ljwsrjjjfivmcb6y6nwlva59ix0-etc/etc /etc/static was creating an etc directory inside of the /etc/static instead of mapping the contents of /nix/store...etc inside the /etc/static directory.
I don't know how I got into that state. Manually rm -rf /etc/static and rerunning of activate fixed it. Future darwin-rebuild switches now work.

@LnL7
Copy link
Owner

LnL7 commented Mar 5, 2017

Ah interesting, I put in a safeguard to prevent issues but apparently the environment variable was still set somehow.
See #9 (comment) if you want to use it, but once you enable it the store will be owned by root so you can't just revert without fixing changing the permissions first. The daemon enables multi user support and has the added benefit that your user can't write directly to the store anymore.

@LnL7
Copy link
Owner

LnL7 commented May 20, 2017

Not sure about the etc issue, but the activation should now correctly fail before setting the environment variable or starting the daemon.

@LnL7 LnL7 closed this as completed May 20, 2017
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

2 participants