135 current 2024-12-31 06:13:16 25.05.20241217.d3c42f1 6.6.66 *

This commit is contained in:
2024-12-31 06:13:23 -05:00
parent 0333d05527
commit 65cfc4c609

View File

@@ -24,13 +24,23 @@ alejandra . &>/dev/null \
git --git-dir /home/synchronous/nix-cfg/.git --no-pager diff -U0 git --git-dir /home/synchronous/nix-cfg/.git --no-pager diff -U0
# '*.nix' # '*.nix'
# Rebuild, output simplified errors, log trackebacks
sudo nixos-rebuild switch --flake /home/synchronous/nix-cfg/flake.nix &> /tmp/nixos-switch.log
cat /tmp/nixos-switch.log | grep --color error && exit 1
echo "" echo ""
echo "NixOS Rebuilding..." echo "NixOS Rebuilding..."
# Rebuild, output simplified errors, log trackebacks
sudo nixos-rebuild switch --flake /home/synchronous/nix-cfg/flake.nix &> /tmp/nixos-switch.log
# cat /tmp/nixos-switch.log | grep --color error && exit 1
if grep --color error /tmp/nixos-switch.log; then
# cat /tmp/nixos-switch.log | grep --color error
read -p "Would you like to view the error log? (y/n): " choice
choice=${choice:-n}
if [[ "$choice" == "y" || "$choice" == "Y" ]]; then
cat /tmp/nixos-switch.log
fi
exit 1;
fi
# Get current generation metadata # Get current generation metadata
current=$(nixos-rebuild list-generations | grep current) current=$(nixos-rebuild list-generations | grep current)