From ee28f76369a53531d8d71bf42cf79b2fc0202a78 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sat, 22 Jul 2017 00:23:36 +0200 Subject: [PATCH] home-environment: fix cleanup of user replaced directories We must only follow the symbolic link once (i.e., not use the `-e` option) since otherwise the pattern will not match when `home.file.xyz.source` is a directory. (cherry picked from commit d807a5c31428138d9d992b835f28db48582149c6) --- modules/home-environment.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/home-environment.nix b/modules/home-environment.nix index f659bcb3f..6596a1162 100644 --- a/modules/home-environment.nix +++ b/modules/home-environment.nix @@ -310,7 +310,7 @@ in targetPath="$HOME/$relativePath" if [[ -e "$newGenFiles/$relativePath" ]] ; then $VERBOSE_ECHO "Checking $targetPath exists" - elif [[ ! "$(readlink -e "$targetPath")" =~ "${pattern}" ]] ; then + elif [[ ! "$(readlink "$targetPath")" =~ "${pattern}" ]] ; then warnEcho "Path '$targetPath' not link into Home Manager generation. Skipping delete." else echo "Checking $targetPath gone (deleting)"