diff options
author | Théophane Hufschmitt <theophane.hufschmitt@tweag.io> | 2022-04-13 10:26:50 +0200 |
---|---|---|
committer | Théophane Hufschmitt <theophane.hufschmitt@tweag.io> | 2023-01-17 14:17:28 +0100 |
commit | a5919f4754be6f4a9fe091e0ee5538ad85af0050 (patch) | |
tree | 748d002f79d961d116a943f141116d1a3e9d27bb /src/nix-channel | |
parent | deb35c84b30b257fd9ffa4f4450d4d73a35bbdc9 (diff) |
Move the default profiles to the user’s home
Rather than using `/nix/var/nix/{profiles,gcroots}/per-user/`, put the user
profiles 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.
Diffstat (limited to 'src/nix-channel')
-rwxr-xr-x | src/nix-channel/nix-channel.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nix-channel/nix-channel.cc b/src/nix-channel/nix-channel.cc index cf52b03b4..263d85eea 100755 --- a/src/nix-channel/nix-channel.cc +++ b/src/nix-channel/nix-channel.cc @@ -1,9 +1,11 @@ +#include "profiles.hh" #include "shared.hh" #include "globals.hh" #include "filetransfer.hh" #include "store-api.hh" #include "legacy.hh" #include "fetchers.hh" +#include "util.hh" #include <fcntl.h> #include <regex> @@ -166,7 +168,7 @@ static int main_nix_channel(int argc, char ** argv) nixDefExpr = home + "/.nix-defexpr"; // Figure out the name of the channels profile. - profile = fmt("%s/profiles/per-user/%s/channels", settings.nixStateDir, getUserName()); + profile = profilesDir() + "/channels"; enum { cNone, |