From 8d9ef95d74fe58302b7fff945162beb01c3e6d33 Mon Sep 17 00:00:00 2001 From: Soispha Date: Tue, 1 Aug 2023 23:58:16 +0200 Subject: 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. --- system/services/nix-sync/default.nix | 4 ++-- 1 file 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"; -- cgit 1.4.1