forked from lix-project/lix
add getDefaultProfileLink()
Change-Id: I38c74da1cf144f50d88ac32eb2afd20388481d06
This commit is contained in:
parent
220b50ad24
commit
aed917e04d
|
@ -315,6 +315,18 @@ Path rootProfilesDir()
|
||||||
return settings.nixStateDir + "/profiles/per-user/root";
|
return settings.nixStateDir + "/profiles/per-user/root";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Path getDefaultProfileLink()
|
||||||
|
{
|
||||||
|
if (getuid() == 0) {
|
||||||
|
return settings.nixStateDir + "/profiles/default";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (settings.useXDGBaseDirectories) {
|
||||||
|
return createNixStateDir() + "/profile";
|
||||||
|
}
|
||||||
|
return getHome() + "/.nix-profile";
|
||||||
|
}
|
||||||
|
|
||||||
Path ensureDefaultProfile()
|
Path ensureDefaultProfile()
|
||||||
{
|
{
|
||||||
Path const profileLink = getDefaultProfileLink();
|
Path const profileLink = getDefaultProfileLink();
|
||||||
|
|
|
@ -227,6 +227,12 @@ Path defaultChannelsDir();
|
||||||
*/
|
*/
|
||||||
Path rootChannelsDir();
|
Path rootChannelsDir();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the symlink that is used as the default profile, but do not resolve it.
|
||||||
|
* (see getDefaultProfile() for where that link is.)
|
||||||
|
*/
|
||||||
|
Path getDefaultProfileLink();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resolve the default profile (~/.nix-profile by default,
|
* Resolve the default profile (~/.nix-profile by default,
|
||||||
* $XDG_STATE_HOME/nix/profile if XDG Base Directory Support is enabled).
|
* $XDG_STATE_HOME/nix/profile if XDG Base Directory Support is enabled).
|
||||||
|
|
Loading…
Reference in a new issue