Fixed issue with git pulls on flake.lock

This commit is contained in:
2026-05-01 10:16:33 +01:00
parent 647cb5c098
commit 2d44cda4de
+19 -5
View File
@@ -10,11 +10,20 @@ default:
_git-sync:
@if [ -n "$(git status --porcelain)" ]; then \
echo ">> Stashing local changes..."; \
git stash; \
git pull --ff-only --recurse-submodules; \
git submodule update --remote --recursive; \
git stash pop; \
if git status --porcelain | grep -q "flake.lock"; then \
echo ">> flake.lock is dirty. Resetting to avoid pull conflicts..."; \
git checkout flake.lock; \
fi; \
if [ -n "$(git status --porcelain)" ]; then \
echo ">> Stashing remaining local changes..."; \
git stash; \
git pull --ff-only --recurse-submodules; \
git submodule update --remote --recursive; \
git stash pop; \
else \
git pull --ff-only --recurse-submodules; \
git submodule update --remote --recursive; \
fi; \
else \
git pull --ff-only --recurse-submodules; \
git submodule update --remote --recursive; \
@@ -23,6 +32,11 @@ _git-sync:
_flake-update:
nix flake update
# Safely commit the lockfile changes
commit-lock:
git add flake.lock
git commit -m "chore: update flake.lock" || echo "No changes to commit"
# Sync git and update flake inputs (override with git=false or flake=false)
prebuild:
@if [ "{{git}}" == "true" ]; then \