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

NIX_PATH can get out of date #5

Closed
chvp opened this issue Mar 24, 2021 · 5 comments
Closed

NIX_PATH can get out of date #5

chvp opened this issue Mar 24, 2021 · 5 comments

Comments

@chvp
Copy link
Contributor

chvp commented Mar 24, 2021

If the system is updated while a user is logged in, their NIX_PATH variable can get out of date when using the saneFlakeDefaults. This can get noticeable if one updates through a full rebuild on a graphical system, resulting in graphical applications accessed through a nix-shell refusing to start. I solved this this way in my flake: https://github.com/chvp/nixos-config/blob/f3a7f168d5bc46fb5d9c7946b59bed327cf1e609/flake.nix#L28-L33 (the .version-suffix file is also useful, nix-direnv relies on it to do its caching).

@gytis-ivaskevicius
Copy link
Owner

This is a known issue (at least to me) that NIX_PATH fails to update due to other applications not re-sourcing /etc/set-environment file.
this was my fix: https://github.com/gytis-ivaskevicius/nixfiles/blob/master/home-manager/sway.nix#L79

I actually never considered that it ever worked differently since I initially moved to flakes quite early on and never paid that much attention to it, but I believe I can fix it by reverting some of the NIX_PATH logic.

Keep in mind that the issue will persist when adding/removing flakes, but I will definitely make sure that at least some of the flakes will use a static path instead. You can expect a fix today/tomorrow

@gytis-ivaskevicius
Copy link
Owner

Also, I created a discussion here: https://discourse.nixos.org/t/i-feel-like-nix-path-creates-more-issues-than-it-fixes/12110, I wonder what are other peeps thoughts on this.

@gytis-ivaskevicius
Copy link
Owner

As commit notes - removed custom NIX_PATH implementation. Does not seem to be too relevant in the new world of flakes

@chvp
Copy link
Contributor Author

chvp commented Mar 24, 2021

Sure, I'll do it myself again. The solution posted on discourse is nice, it saves a slow derivation from what I used to do.

@chvp chvp closed this as completed Mar 24, 2021
@chvp
Copy link
Contributor Author

chvp commented Mar 24, 2021

For anyone stumbling upon this issue later: this is how I ended up solving it in my flake: https://github.com/chvp/nixos-config/blob/17a4f0a7a104ad263f5e361f57e18c6a5009eca5/flake.nix#L22-L25

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