diff --git a/modules/files.nix b/modules/files.nix index a7fd67f57..3edd1f964 100644 --- a/modules/files.nix +++ b/modules/files.nix @@ -343,8 +343,13 @@ in # We therefore simply log the conflict and otherwise ignore it, mainly # to make the `files-target-config` test work as expected. if [[ -e "$realOut/$relTarget" ]]; then - echo "File conflict for file '$relTarget'" >&2 - return + if [[ -d "$realOut/$relTarget" && $(realpath "$realOut/$relTarget") == $realOut && $recursive ]]; then + # exception: allow a "collision" for a recureively linked home *directory* + : + else + echo "File conflict for file '$relTarget'" >&2 + return + fi fi # Figure out the real absolute path to the target.