diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2017-05-05T14·40+0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2017-05-05T15·08+0200 |
commit | 465cb6824401541d82489e11b5223dbfd50bb132 (patch) | |
tree | 98b112563cbf08c29e94c4ddc0755de95524186f /src/nix-channel/nix-channel.cc | |
parent | eba840c8a13b465ace90172ff76a0db2899ab11b (diff) |
Figure out the user's home directory if $HOME is not set
Diffstat (limited to 'src/nix-channel/nix-channel.cc')
-rwxr-xr-x | src/nix-channel/nix-channel.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/nix-channel/nix-channel.cc b/src/nix-channel/nix-channel.cc index 0f50f6242c48..2aaae2f471b9 100755 --- a/src/nix-channel/nix-channel.cc +++ b/src/nix-channel/nix-channel.cc @@ -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"; |