aboutsummaryrefslogtreecommitdiff
path: root/src/nix-env/nix-env.cc
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-env/nix-env.cc
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-env/nix-env.cc')
-rw-r--r--src/nix-env/nix-env.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc
index 3a012638b..aa7ada37d 100644
--- a/src/nix-env/nix-env.cc
+++ b/src/nix-env/nix-env.cc
@@ -1403,11 +1403,11 @@ static int main_nix_env(int argc, char * * argv)
try {
createDirs(globals.instSource.nixExprPath);
replaceSymlink(
- fmt("%s/profiles/per-user/%s/channels", settings.nixStateDir, getUserName()),
+ defaultChannelsDir(),
globals.instSource.nixExprPath + "/channels");
if (getuid() != 0)
replaceSymlink(
- fmt("%s/profiles/per-user/root/channels", settings.nixStateDir),
+ rootChannelsDir(),
globals.instSource.nixExprPath + "/channels_root");
} catch (Error &) { }
}