diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-06-02 21:31:52 +0200 |
---|---|---|
committer | Silas Schöffel <sils@sils.li> | 2024-06-05 18:42:47 +0200 |
commit | 2742072176a41f61e09d62e5a348726effaa1ccb (patch) | |
tree | 7c2bacfb84df091e31f9b86ee9e1e4b2b46c776c | |
parent | fix(nix-sync): Ensure that the service can write to all needed paths (diff) | |
download | nixos-server-2742072176a41f61e09d62e5a348726effaa1ccb.tar.gz nixos-server-2742072176a41f61e09d62e5a348726effaa1ccb.zip |
fix(nix-sync): Add code-path to create a repo's path, if absent
-rw-r--r-- | system/services/nix-sync/default.nix | 6 |
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}; |