From a1cb111cc3c53066491f007b2dcaca4076def7ec Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sat, 7 Jan 2017 19:36:39 +0100 Subject: [PATCH] home-manager: handle missing `home-manager-path` When listing packages we have to handle the case where the rebuild command has not yet been run. --- home-manager/home-manager | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/home-manager/home-manager b/home-manager/home-manager index 63dac595..1667564a 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -29,7 +29,11 @@ function doListGens() { function doListPackages() { local outPath outPath="$(nix-env -q --out-path | grep -o '/.*home-manager-path$')" - nix-store -q --references "$outPath" | sed 's/[^-]*-//' + if [[ -n "$outPath" ]] ; then + nix-store -q --references "$outPath" | sed 's/[^-]*-//' + else + echo "No home-manager packages seem to be installed." + fi } function doHelp() {