mirror of
https://github.com/nix-community/home-manager
synced 2024-12-02 16:09:46 +01:00
Files: allow target to be the home directory, for recursively-linked directories
In order to create assorted symlinks directly in the home directory, it might be necessary to have a `home.file` directive which targets the home directory directly. This is only allowed for recursively-linked directories, as even a simply-linked directory would cause the system to break (due to a readonly ~/.nix-profile, among others)
This commit is contained in:
parent
60c6bfe322
commit
27981ab4a2
1 changed files with 7 additions and 2 deletions
|
@ -343,9 +343,14 @@ in
|
||||||
# We therefore simply log the conflict and otherwise ignore it, mainly
|
# We therefore simply log the conflict and otherwise ignore it, mainly
|
||||||
# to make the `files-target-config` test work as expected.
|
# to make the `files-target-config` test work as expected.
|
||||||
if [[ -e "$realOut/$relTarget" ]]; then
|
if [[ -e "$realOut/$relTarget" ]]; then
|
||||||
|
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
|
echo "File conflict for file '$relTarget'" >&2
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Figure out the real absolute path to the target.
|
# Figure out the real absolute path to the target.
|
||||||
local target
|
local target
|
||||||
|
|
Loading…
Reference in a new issue