add rebuild script

This commit is contained in:
2025-10-04 12:35:51 -05:00
parent e1dad80c02
commit 08f3418674

12
rebuild.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
set -e
pushd ~/.nix
nvim flake.nix
alejandra . &>/dev/null
git diff -U0 *.nix
echo "nixos rebuilding..."
sudo nixos-rebuild switch --flake ~/.nix#snowbelle &>nixos-switch.log || (
cat nixos-switch.log | grep --color error && false)
gen=$(nixos-rebuild list-generations | grep current)
git commit -am "$gen"
popd