From 986c24ec45f1982c0e2064240ae94d503e95b6de Mon Sep 17 00:00:00 2001 From: Felix Schulze Date: Tue, 3 Jun 2025 20:06:42 +0200 Subject: [PATCH] 127 current 2025-06-03 20:06:40 25.05.20250602.10d7f8d 6.15.0 * autoformat nix files --- modules/programs.nix | 1 + rebuild-nix-system.sh | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/modules/programs.nix b/modules/programs.nix index 4146335..7b96583 100644 --- a/modules/programs.nix +++ b/modules/programs.nix @@ -22,6 +22,7 @@ pciutils glxinfo btop + alejandra # Development code-cursor diff --git a/rebuild-nix-system.sh b/rebuild-nix-system.sh index b9405c0..af877ce 100755 --- a/rebuild-nix-system.sh +++ b/rebuild-nix-system.sh @@ -25,6 +25,17 @@ else fi fi +# Early return if no changes were detected +if git diff --quiet '*.nix'; then + echo "No changes detected, exiting." + popd + exit 0 +fi + +# Autoformat your nix files +alejandra . &>/dev/null \ + || ( alejandra . ; echo "formatting failed!" && exit 1) + # Shows your changes git diff -U0 '*.nix'