Skip to content

Commit 7a21c7f

Browse files
committed
source: Don't dereference links when linking
This ensures overridden symlinks to directories are not attempted to be linked as a subdir by `ln`. e.g. with `build/core` already a symlink to something, the following would not work: ``` $ mkdir -p build $ ln -sf --relative build/make/core build/core ln: failed to create symbolic link 'build/core/core': Permission denied ``` Observe how the destination is `build/core`, but the link attempted to be created is `build/core/core`. From the manpage: > ``` > --no-dereference treat LINK_NAME as a normal file if it is a > symbolic link to a directory > ```
1 parent d9f9781 commit 7a21c7f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/source.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ let
198198
'') config.copyfiles)
199199
+ (lib.concatMapStringsSep "\n" (c: ''
200200
mkdir -p $(dirname ${c.dest})
201-
ln -sf --relative ${config.relpath}/${c.src} ${c.dest}
201+
ln --no-dereference -sf --relative ${config.relpath}/${c.src} ${c.dest}
202202
'') config.linkfiles);
203203
};
204204
});

0 commit comments

Comments
 (0)