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:
parent
d7d02c3ce8
commit
a1cb111cc3
|
@ -29,7 +29,11 @@ function doListGens() {
|
||||||
function doListPackages() {
|
function doListPackages() {
|
||||||
local outPath
|
local outPath
|
||||||
outPath="$(nix-env -q --out-path | grep -o '/.*home-manager-path$')"
|
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() {
|
function doHelp() {
|
||||||
|
|
Loading…
Reference in a new issue