mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 22:16:16 +02:00
nix-env: Ignore failures creating ~/.nix-profile and ~/.nix-defexpr
https://hydra.nixos.org/build/102803093
This commit is contained in:
parent
bda64a2b0f
commit
c3aaf3b8da
1 changed files with 20 additions and 14 deletions
|
@ -1325,6 +1325,7 @@ static int _main(int argc, char * * argv)
|
|||
globals.instSource.systemFilter = "*";
|
||||
|
||||
if (!pathExists(globals.instSource.nixExprPath)) {
|
||||
try {
|
||||
createDirs(globals.instSource.nixExprPath);
|
||||
replaceSymlink(
|
||||
fmt("%s/profiles/per-user/%s/channels", settings.nixStateDir, getUserName()),
|
||||
|
@ -1333,6 +1334,7 @@ static int _main(int argc, char * * argv)
|
|||
replaceSymlink(
|
||||
fmt("%s/profiles/per-user/root/channels", settings.nixStateDir),
|
||||
globals.instSource.nixExprPath + "/channels_root");
|
||||
} catch (Error &) { }
|
||||
}
|
||||
|
||||
globals.dryRun = false;
|
||||
|
@ -1427,6 +1429,7 @@ static int _main(int argc, char * * argv)
|
|||
|
||||
if (globals.profile == "") {
|
||||
Path profileLink = getHome() + "/.nix-profile";
|
||||
try {
|
||||
if (!pathExists(profileLink)) {
|
||||
replaceSymlink(
|
||||
getuid() == 0
|
||||
|
@ -1435,6 +1438,9 @@ static int _main(int argc, char * * argv)
|
|||
profileLink);
|
||||
}
|
||||
globals.profile = absPath(readLink(profileLink), dirOf(profileLink));
|
||||
} catch (Error &) {
|
||||
globals.profile = profileLink;
|
||||
}
|
||||
}
|
||||
|
||||
op(globals, opFlags, opArgs);
|
||||
|
|
Loading…
Reference in a new issue