From a15b2c01c0bac226ed34d8ba7e10a563c4a54890 Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Fri, 2 Jun 2023 15:38:17 +0000 Subject: [PATCH] Document manual migration for use-xdg-base-directories (#8044) * Document manual migration for use-xdg-base-directories As there's currently no automatic migration for use-xdg-base-directories option, add instructions for manual migration to the option's description. Co-authored-by: Valentin Gagarin --- src/libstore/globals.hh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh index 31dfe5b4e..07f524858 100644 --- a/src/libstore/globals.hh +++ b/src/libstore/globals.hh @@ -995,6 +995,18 @@ public: | `~/.nix-profile` | `$XDG_STATE_HOME/nix/profile` | | `~/.nix-defexpr` | `$XDG_STATE_HOME/nix/defexpr` | | `~/.nix-channels` | `$XDG_STATE_HOME/nix/channels` | + + If you already have Nix installed and are using [profiles](@docroot@/package-management/profiles.md) or [channels](@docroot@/package-management/channels.md), you should migrate manually when you enable this option. + If `$XDG_STATE_HOME` is not set, use `$HOME/.local/state/nix` instead of `$XDG_STATE_HOME/nix`. + This can be achieved with the following shell commands: + + ```sh + nix_state_home=${XDG_STATE_HOME-$HOME/.local/state}/nix + mkdir -p $nix_state_home + mv $HOME/.nix-profile $nix_state_home/profile + mv $HOME/.nix-defexpr $nix_state_home/defexpr + mv $HOME/.nix-channels $nix_state_home/channels + ``` )" }; };