summary refs log tree commit diff stats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--system/services/nix-sync/default.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/system/services/nix-sync/default.nix b/system/services/nix-sync/default.nix
index d54e4da..33df88e 100644
--- a/system/services/nix-sync/default.nix
+++ b/system/services/nix-sync/default.nix
@@ -72,7 +72,10 @@
         nix build . --print-out-paths --experimental-features 'nix-command flakes' > "$out_paths";
         [ "$(wc -l < "$out_paths")" -gt 1 ] && (echo "To many out-paths"; exit 1)
         out_path="$(cat "$out_paths")";
-        rm ${esa repo.path};
+
+        [ -d ${esa repo.path} ] && rm -d ${esa repo.path};
+        [ -e ${esa repo.path} ] && rm ${esa repo.path};
+
         ln -s "$out_path" ${esa repo.path};
         rm "$out_paths";
       fi