summary refs log tree commit diff stats
path: root/system/services
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-07-05 20:39:07 +0200
committerSoispha <soispha@vhack.eu>2023-07-05 20:39:07 +0200
commit0ac98855c3b70430197155fcc8737e4ad39dfb20 (patch)
treed7d013b558ba98b4b4c4875413604dcca405781f /system/services
parentFix(system/fs_layout/impermanence): Make sshd dir 755 (diff)
downloadnixos-server-0ac98855c3b70430197155fcc8737e4ad39dfb20.tar.gz
nixos-server-0ac98855c3b70430197155fcc8737e4ad39dfb20.zip
Fix(system/services/nix-sync): Small typos in ExecStart
Diffstat (limited to 'system/services')
-rw-r--r--system/services/nix-sync/default.nix8
1 files changed, 5 insertions, 3 deletions
diff --git a/system/services/nix-sync/default.nix b/system/services/nix-sync/default.nix
index ed0a4fe..d77cb93 100644
--- a/system/services/nix-sync/default.nix
+++ b/system/services/nix-sync/default.nix
@@ -32,9 +32,11 @@
       export XDG_CACHE_HOME="$CACHE_DIRECTORY";
       cd ${esa repoCachePath};
 
+      git fetch
       origin="$(git rev-parse @{u})";
       branch="$(git rev-parse @)";
 
+      # FIXME: this will fail, after a `nix store gc` as the link is not in the gc-roots
       if ! [ "$origin" = "$branch" ]; then
         git pull;
 
@@ -44,12 +46,12 @@
         out_path="$(cat "$out_paths")";
         rm -r ${esa repo.path};
         ln -s "$out_path" ${esa repo.path};
-        rm "$out-paths";
+        rm "$out_paths";
       fi
     '';
     execStartPreScript = ''
       export XDG_CACHE_HOME="$CACHE_DIRECTORY";
-      if ! stat ${esa repoCachePath}/.git; then
+      if ! stat ${esa repoCachePath}/.git 1>/dev/null 2>&1; then
           mkdir --parents ${esa repoCachePath};
           git clone ${esa repo.uri} ${esa repoCachePath};
 
@@ -58,7 +60,7 @@
           [ "$(wc -l < "$out_paths")" -gt 1 ] && (echo "To many out-paths"; exit 1)
           out_path="$(cat "$out_paths")";
           ln -s "$out_path" ${esa repo.path};
-          rm "$out-paths";
+          rm "$out_paths";
       fi
     '';
   in {