From 9b81ec39616c4d4981ba48f6c10a8f2abdc9a788 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sat, 15 Jun 2024 12:09:12 +0200 Subject: fix(nix-sync): Change last occurrences of `repo.path` to `repoPath` Using `repo.path` (with the slash on the end) results in operations on the directory, which is the symlink target. Using `repoPath` (without the slash) instead results in the intended operations on the symlink itself. --- system/services/nix-sync/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/system/services/nix-sync/default.nix b/system/services/nix-sync/default.nix index efa04a3..a3ab0af 100644 --- a/system/services/nix-sync/default.nix +++ b/system/services/nix-sync/default.nix @@ -57,7 +57,7 @@ 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}; + rm ${esa repoPath}; ln -s "$out_path" ${esa repoPath}; rm "$out_paths"; fi @@ -77,7 +77,7 @@ rm "$out_paths"; fi - if ! [ -L ${esa repo.path} ]; then + if ! [ -L ${esa repoPath} ]; then cd ${esa repoCachePath}; git pull --rebase; @@ -87,12 +87,12 @@ [ "$(wc -l < "$out_paths")" -gt 1 ] && { echo "To many out-paths"; exit 1; } out_path="$(cat "$out_paths")"; - if [ -d ${esa repo.path} ]; then - rm -d ${esa repo.path}; + if [ -d ${esa repoPath} ]; then + rm -d ${esa repoPath}; else - mkdir --parents "$(dirname ${esa repo.path})"; + mkdir --parents "$(dirname ${esa repoPath})"; fi - [ -e ${esa repo.path} ] && rm ${esa repo.path}; + [ -e ${esa repoPath} ] && rm ${esa repoPath}; ln -s "$out_path" ${esa repoPath}; rm "$out_paths"; -- cgit 1.4.1