1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-18 12:38:30 +02:00

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.
This commit is contained in:
Robert Helgesson 2017-01-07 19:36:39 +01:00
parent d7d02c3ce8
commit a1cb111cc3
No known key found for this signature in database
GPG Key ID: C3DB11069E65DC86

View File

@ -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() {