about summary refs log tree commit diff
path: root/src/nix-channel
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-channel')
-rwxr-xr-xsrc/nix-channel/nix-channel.cc4
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";