From 8a923ed33634ed71600eb6823a17c1ccf46e2938 Mon Sep 17 00:00:00 2001 From: James N <59348282+RandomSpaceship@users.noreply.github.com> Date: Sun, 5 Jan 2025 19:19:19 +1000 Subject: [PATCH] scripts(nix-setup): Disable Nix dirty git tree warning --- software/scripts/nix-setup.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/software/scripts/nix-setup.sh b/software/scripts/nix-setup.sh index 8caad9a..417ffcf 100755 --- a/software/scripts/nix-setup.sh +++ b/software/scripts/nix-setup.sh @@ -45,6 +45,15 @@ else RESTART_NIX_DAEMON=true fi +DISABLE_WARN_DIRTY="warn-dirty = false" +if grep -Fq "$DISABLE_WARN_DIRTY" /etc/nix/nix.conf; then + echo "Dirty git tree warning already disabled!" +else + echo "Disabling dirty git tree warning..." + echo "$DISABLE_WARN_DIRTY" | sudo tee -a /etc/nix/nix.conf + RESTART_NIX_DAEMON=true +fi + # restart Nix daemon so above changes take effect - but only if needed if [ "${RESTART_NIX_DAEMON:-}" = true ]; then echo "Restarting nix daemon"