diff --git a/modules/home-environment.nix b/modules/home-environment.nix index e186dd6c0..b8908b9ad 100644 --- a/modules/home-environment.nix +++ b/modules/home-environment.nix @@ -680,7 +680,15 @@ in getVersion = pkgs.writeShellScript "get-hm-version" '' set -euo pipefail - cd "${../.}" || exit 1 + dir="${../.}" + + # Apparently, dir is not always set to the Home Manager directory. + if [[ ! -d $dir ]]; then + echo "" + exit 0 + fi + + cd "$dir" || exit 1 # Get the base release and initialize an empty version suffix. release=$(< .release)