-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Move the default profiles to the user’s home #5226
Conversation
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/tweag-nix-dev-update-17/15037/1 |
1d719a6
to
b6f17b8
Compare
b6f17b8
to
729c1b6
Compare
I'm looking at how to adapt Home Manager to this change. Should I use some HM specific directory to keep the profile and gcroot? E.g. Also, this commit doesn't seem to contain any documentation updates. Are those in a separate PR? |
Hmm, I had a look at |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [cachix/install-nix-action](https://togithub.com/cachix/install-nix-action) | action | major | `v19` -> `v20` | --- ### Release Notes <details> <summary>cachix/install-nix-action</summary> ### [`v20`](https://togithub.com/cachix/install-nix-action/releases/tag/v20): install-nix-action-v20 [Compare Source](https://togithub.com/cachix/install-nix-action/compare/v19...v20) https://discourse.nixos.org/t/nix-2-14-0-released/25900/4Fix support for Nix 2.14 new profile location: [https://github.com/NixOS/nix/pull/5226](https://togithub.com/NixOS/nix/pull/5226) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "every weekend" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/bobvanderlinden/nixpkgs-ruby). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNTQuNiIsInVwZGF0ZWRJblZlciI6IjM0LjE1NC42In0=-->
Interesting. I just hit this issue when trying to use the Nix static inside a Steam Deck, with the store inside |
@rycee Apparently this still needs more work on our side. Please open an issue so we can discuss it on the team. |
To address this issue: * cachix/install-nix-action#161 For context: * NixOS/nix#5226 * NixOS/nix#7925 * cachix/install-nix-action#163
To address this issue: * cachix/install-nix-action#161 For context: * NixOS/nix#5226 * NixOS/nix#7925 * cachix/install-nix-action#163
Low-hanging fix for NixOS#5226 (comment)
Low-hanging fix for NixOS#5226 (comment)
Low-hanging fix for #5226 (comment) (cherry picked from commit 2272bc6)
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [cachix/install-nix-action](https://togithub.com/cachix/install-nix-action) | action | major | `v19` -> `v20` | --- ### Release Notes <details> <summary>cachix/install-nix-action</summary> ### [`v20`](https://togithub.com/cachix/install-nix-action/releases/tag/v20): install-nix-action-v20 [Compare Source](https://togithub.com/cachix/install-nix-action/compare/v19...v20) https://discourse.nixos.org/t/nix-2-14-0-released/25900/4Fix support for Nix 2.14 new profile location: [https://github.com/NixOS/nix/pull/5226](https://togithub.com/NixOS/nix/pull/5226) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/mmlb/each-commit-green). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNTkuMCIsInVwZGF0ZWRJblZlciI6IjM0LjE1OS4wIn0=-->
To address this issue: * cachix/install-nix-action#161 For context: * NixOS/nix#5226 * NixOS/nix#7925 * cachix/install-nix-action#163
To address this issue: * cachix/install-nix-action#161 For context: * NixOS/nix#5226 * NixOS/nix#7925 * cachix/install-nix-action#163
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nix-team-report-2022-10-2023-03/27486/1 |
Move the default profiles to the user’s home
Problem: Since NixOS/nix#5226 nix profiles for users are stored in 'XDG_STATE_HOME' or 'HOME' directory. However, 'deploy-rs' still expects profiles to be present in '/nix/var/nix/profiles/per-user'. As a result, an attempt to deploy a profile with newer nix may fail with an error about non-existing files. Solution: Instead of deducing the profile path prior to ssh'ing and actual activation, deduce the path to the profile during as a part of 'activate-rs' invocation. Now if the profile path is not specified explicitly as an attribute in profile within the deploy flake, the path to the profile is determined based on the user to which the profile belongs and on the values of 'XDG_STATE_HOME' and 'HOME' variables. Additionally, if the old profile directory (in '/nix/var/nix/profiles/per-user') for a given user already exists, it is used instead for the sake of backward compatibility.
Problem: Since NixOS/nix#5226 nix profiles for users are stored in 'XDG_STATE_HOME' or 'HOME' directory. However, 'deploy-rs' still expects profiles to be present in '/nix/var/nix/profiles/per-user'. As a result, an attempt to deploy a profile with newer nix may fail with an error about non-existing files. Solution: Instead of deducing the profile path prior to ssh'ing and actual activation, deduce the path to the profile during as a part of 'activate-rs' invocation. Now if the profile path is not specified explicitly as an attribute in profile within the deploy flake, the path to the profile is determined based on the user to which the profile belongs and on the values of 'XDG_STATE_HOME' and 'HOME' variables. Additionally, if the old profile directory (in '/nix/var/nix/profiles/per-user') for a given user already exists, it is used instead for the sake of backward compatibility.
Problem: Since NixOS/nix#5226 nix profiles for users are stored in 'XDG_STATE_HOME' or 'HOME' directory. However, 'deploy-rs' still expects profiles to be present in '/nix/var/nix/profiles/per-user'. As a result, an attempt to deploy a profile with newer nix may fail with an error about non-existing files. Solution: Instead of deducing the profile path prior to ssh'ing and actual activation, deduce the path to the profile during as a part of 'activate-rs' invocation. Now if the profile path is not specified explicitly as an attribute in profile within the deploy flake, the path to the profile is determined based on the user to which the profile belongs and on the values of 'XDG_STATE_HOME' and 'HOME' variables. Additionally, if the old profile directory (in '/nix/var/nix/profiles/per-user') for a given user already exists, it is used instead for the sake of backward compatibility.
Problem: Since NixOS/nix#5226 nix profiles for users are stored in 'XDG_STATE_HOME' or 'HOME' directory. However, 'deploy-rs' still expects profiles to be present in '/nix/var/nix/profiles/per-user'. As a result, an attempt to deploy a profile with newer nix may fail with an error about non-existing files. Solution: Instead of deducing the profile path prior to ssh'ing and actual activation, deduce the path to the profile during as a part of 'activate-rs' invocation. Now if the profile path is not specified explicitly as an attribute in profile within the deploy flake, the path to the profile is determined based on the user to which the profile belongs and on the values of 'XDG_STATE_HOME' and 'HOME' variables. Additionally, if the old profile directory (in '/nix/var/nix/profiles/per-user') for a given user already exists, it is used instead for the sake of backward compatibility.
Problem: Since NixOS/nix#5226 nix profiles for users are stored in 'XDG_STATE_HOME' or 'HOME' directory. However, 'deploy-rs' still expects profiles to be present in '/nix/var/nix/profiles/per-user'. As a result, an attempt to deploy a profile with newer nix may fail with an error about non-existing files. Solution: Instead of deducing the profile path prior to ssh'ing and actual activation, deduce the path to the profile during as a part of 'activate-rs' invocation. Now if the profile path is not specified explicitly as an attribute in profile within the deploy flake, the path to the profile is determined based on the user to which the profile belongs and on the values of 'XDG_STATE_HOME' and 'HOME' variables. Additionally, if the old profile directory (in '/nix/var/nix/profiles/per-user') for a given user already exists, it is used instead for the sake of backward compatibility.
Rather than using
/nix/var/nix/{profiles,gcroots}/per-user/
, put the userprofiles and gcroots under
$XDG_DATA_DIR/nix/{profiles,gcroots}
.This means that the daemon no longer needs to manage these paths itself
(they are fully handled client-side). In particular, it doesn’t have to
chown
them anymore (removing one need for root).This does change the layout of the gc-roots created by nix-env, and is
likely to break some stuff, so I’m not sure how to properly handle that.
First step towards #5208