From 97a47d7f10ae8d5f1aaa66457a5427967134f45e Mon Sep 17 00:00:00 2001 From: Grey Jones Date: Tue, 1 Sep 2026 06:27:46 +0100 Subject: [PATCH] mkSymlinkActivationScript: add overall check for existence of source --- flake.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 343bfb6..97053c1 100644 --- a/flake.nix +++ b/flake.nix @@ -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;