diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-06-15 12:09:12 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-06-15 12:09:12 +0200 |
commit | 9b81ec39616c4d4981ba48f6c10a8f2abdc9a788 (patch) | |
tree | b98522827c67199bd0bc8a293f7f82a527e3f87b | |
parent | fix(secrets.nix): Remove non-existent `settings.age` secret file (diff) | |
download | nixos-server-9b81ec39616c4d4981ba48f6c10a8f2abdc9a788.tar.gz nixos-server-9b81ec39616c4d4981ba48f6c10a8f2abdc9a788.zip |
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.
-rw-r--r-- | system/services/nix-sync/default.nix | 12 |
1 files 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"; |