aboutsummaryrefslogtreecommitdiff
path: root/modules/home-environment.nix
diff options
context:
space:
mode:
authorRobin Stumm <serverkorken@gmail.com>2017-07-06 18:31:40 +0200
committerRobert Helgesson <robert@rycee.net>2017-07-08 00:38:57 +0200
commit89dc8c200488be358ca3f48b1b56641667f14c92 (patch)
treec07d9f33c1eb909585eb15c2e398e7606ba4f4cf /modules/home-environment.nix
parente274fc732b141c9afd8f924d581153e14f929444 (diff)
home-environment: fix `home.activation.checkLinkTargets`
Problem ------- We resolve symlinks from inside `/nix/store/HASH-home-manager-files` into the nix store as `/nix/store/HASH-DRVNAME` which does not match the pattern. This happened to me because I pull in some repos in via `home.file`. The `home-manager-files` derivation links to the repo's derivation in the nix store. For example: let nanorcs = fetchFromGitHub { owner = "scopatz"; repo = "nanorc"; … }; in [ { target = ".nano"; source = nanorcs; } { target = ".nanorc"; source = "${nanorcs}/nanorc"; } ] Solution -------- Call `readlink` without `-e` to obtain only the first redirection from `~` to `/nix/store/HASH-home-manager-files`.
Diffstat (limited to 'modules/home-environment.nix')
-rw-r--r--modules/home-environment.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/home-environment.nix b/modules/home-environment.nix
index 79b4f3444ff..cf4c49c5c5c 100644
--- a/modules/home-environment.nix
+++ b/modules/home-environment.nix
@@ -260,7 +260,7 @@ in
relativePath="''${sourcePath#$newGenFiles/}"
targetPath="$HOME/$relativePath"
if [[ -e "$targetPath" \
- && ! "$(readlink -e "$targetPath")" =~ "${pattern}" ]] ; then
+ && ! "$(readlink "$targetPath")" =~ "${pattern}" ]] ; then
errorEcho "Existing file '$targetPath' is in the way"
collision=1
fi