aboutsummaryrefslogtreecommitdiff
path: root/src/nix-channel
diff options
context:
space:
mode:
authorThéophane Hufschmitt <theophane.hufschmitt@tweag.io>2023-03-21 13:37:19 +0100
committerThéophane Hufschmitt <theophane.hufschmitt@tweag.io>2023-03-23 10:22:42 +0100
commitfb67c1a1fb5eba91abe3ab411a93cb49960454cf (patch)
tree97de0e98ab87a1c3961220af996193aaa5e1a917 /src/nix-channel
parent82bd9535dd663209a38c1e6ebd8867875fa363ef (diff)
Factor out the generation of the profile/channel directory
Make sure that all the code paths use the same one, and that the backwards-compatibility measures are probably in place when needed
Diffstat (limited to 'src/nix-channel')
-rwxr-xr-xsrc/nix-channel/nix-channel.cc7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/nix-channel/nix-channel.cc b/src/nix-channel/nix-channel.cc
index a79354404..740737ffe 100755
--- a/src/nix-channel/nix-channel.cc
+++ b/src/nix-channel/nix-channel.cc
@@ -168,12 +168,7 @@ static int main_nix_channel(int argc, char ** argv)
nixDefExpr = settings.useXDGBaseDirectories ? createNixStateDir() + "/defexpr" : home + "/.nix-defexpr";
// Figure out the name of the channels profile.
- // For backwards-compatibility, install the root channels under
- // a custom location, as these are also used as "global" channeles, and
- // their location is hardcoded in a number of places.
- profile = getuid() == 0
- ? settings.nixStateDir + "/profiles/per-user/root/channels"
- : profilesDir() + "/channels";
+ profile = profilesDir() + "/channels";
createDirs(dirOf(profile));
enum {