summary refs log tree commit diff stats
path: root/system/services
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-08-01 23:58:16 +0200
committerSoispha <soispha@vhack.eu>2023-08-02 16:19:27 +0200
commit8d9ef95d74fe58302b7fff945162beb01c3e6d33 (patch)
treece54b37c76c7bd51db50a537941e64144237d376 /system/services
parentFix(system/services/nix-sync): Make the timer relative to the unit start (diff)
downloadnixos-server-8d9ef95d74fe58302b7fff945162beb01c3e6d33.tar.gz
nixos-server-8d9ef95d74fe58302b7fff945162beb01c3e6d33.zip
Fix(system/services/nix-sync): Rebase on pulls, to allow for force pushes
As the nix-sync service should _never_ commit new stuff, this rebase
should always be a fast-forward, i.e. it works without manual
intervention.
Without the rebase as argument, this services would break, when the
history gets rewritten, for example on a amended commit.
Diffstat (limited to '')
-rw-r--r--system/services/nix-sync/default.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/system/services/nix-sync/default.nix b/system/services/nix-sync/default.nix
index 482c268..cedbb91 100644
--- a/system/services/nix-sync/default.nix
+++ b/system/services/nix-sync/default.nix
@@ -37,7 +37,7 @@
       branch="$(git rev-parse @)";
 
       if ! [ "$origin" = "$branch" ]; then
-        git pull;
+        git pull --rebase;
 
         out_paths=$(mktemp);
         nix build . --print-out-paths --experimental-features 'nix-command flakes' > "$out_paths";
@@ -66,7 +66,7 @@
       if ! [ -L ${esa repo.path} ]; then
         cd ${esa repoCachePath};
 
-        git pull;
+        git pull --rebase;
 
         out_paths=$(mktemp);
         nix build . --print-out-paths --experimental-features 'nix-command flakes' > "$out_paths";