mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
Misc changes from the flakes branch
This commit is contained in:
parent
c85097da7c
commit
0a10854f85
22 changed files with 110 additions and 60 deletions
|
@ -1428,21 +1428,8 @@ static int _main(int argc, char * * argv)
|
|||
if (globals.profile == "")
|
||||
globals.profile = getEnv("NIX_PROFILE").value_or("");
|
||||
|
||||
if (globals.profile == "") {
|
||||
Path profileLink = getHome() + "/.nix-profile";
|
||||
try {
|
||||
if (!pathExists(profileLink)) {
|
||||
replaceSymlink(
|
||||
getuid() == 0
|
||||
? settings.nixStateDir + "/profiles/default"
|
||||
: fmt("%s/profiles/per-user/%s/profile", settings.nixStateDir, getUserName()),
|
||||
profileLink);
|
||||
}
|
||||
globals.profile = absPath(readLink(profileLink), dirOf(profileLink));
|
||||
} catch (Error &) {
|
||||
globals.profile = profileLink;
|
||||
}
|
||||
}
|
||||
if (globals.profile == "")
|
||||
globals.profile = getDefaultProfile();
|
||||
|
||||
op(globals, opFlags, opArgs);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue