1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-03 02:01:48 +02:00

Figure out the user's home directory if $HOME is not set

This commit is contained in:
Eelco Dolstra 2017-05-05 16:40:12 +02:00
parent eba840c8a1
commit 465cb68244
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
8 changed files with 84 additions and 36 deletions

View file

@ -169,9 +169,7 @@ int main(int argc, char ** argv)
setenv("NIX_DOWNLOAD_CACHE", channelCache.c_str(), 1);
// Figure out the name of the `.nix-channels' file to use
auto home = getEnv("HOME");
if (home.empty())
throw Error("$HOME not set");
auto home = getHome();
channelsList = home + "/.nix-channels";
nixDefExpr = home + "/.nix-defexpr";