summary refs log tree commit diff stats
path: root/system/services
diff options
context:
space:
mode:
Diffstat (limited to 'system/services')
-rw-r--r--system/services/nix-sync/default.nix6
1 files changed, 5 insertions, 1 deletions
diff --git a/system/services/nix-sync/default.nix b/system/services/nix-sync/default.nix
index 082a8f0..b4a9803 100644
--- a/system/services/nix-sync/default.nix
+++ b/system/services/nix-sync/default.nix
@@ -81,7 +81,11 @@
         [ "$(wc -l < "$out_paths")" -gt 1 ] && (echo "To many out-paths"; exit 1)
         out_path="$(cat "$out_paths")";
 
-        [ -d ${esa repo.path} ] && rm -d ${esa repo.path};
+        if [ -d ${esa repo.path} ]; then
+          rm -d ${esa repo.path};
+        else
+          mkdir --parents "$(dirname ${esa repo.path})";
+        fi
         [ -e ${esa repo.path} ] && rm ${esa repo.path};
 
         ln -s "$out_path" ${esa repo.path};