mkSymlinkActivationScript: add overall check for existence of source

This commit is contained in:
greyweather committed 2026-09-01 06:27:46 +01:00
1 parent 3131ebbfcd
commit 97a47d7f10
1 file changed
+5 -3
+5 -3
View File
@@ -12,10 +12,12 @@
];
mkSymlinkActivationScript = {target, source}: ''
if [ -e ${target} ]; then
rm -rf ${target}
if [ -e ${source} ]; then
if [ -e ${target} ]; then
rm -rf ${target}
fi
ln -s ${source} ${target}
fi
ln -s ${source} ${target}
'';
attrByStrPath = strPath: set: nixpkgs.lib.attrByPath (nixpkgs.lib.strings.splitString "." strPath) null set;