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:
parent
eba840c8a1
commit
465cb68244
8 changed files with 84 additions and 36 deletions
|
@ -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";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue