add comment to flake.nix w/ gen #

This commit is contained in:
2025-10-04 12:57:34 -05:00
parent a489d0f20f
commit 7698f7dbd8

View File

@@ -4,6 +4,14 @@ pushd ~/.nix
# nvim flake.nix # nvim flake.nix
# alejandra . &>/dev/null # alejandra . &>/dev/null
git diff -U0 *.nix git diff -U0 *.nix
# add generation comment to flake.nix
if grep -q '^# generation:' flake.nix; then
sed -i "1s/^# generation:.*/# generation: $gen/" flake.nix
else
sed -i "1i# generation: $gen" flake.nix
fi
echo "nixos rebuilding..." echo "nixos rebuilding..."
sudo nixos-rebuild switch --flake ~/.nix#snowbelle &>.nixos-switch-log || ( sudo nixos-rebuild switch --flake ~/.nix#snowbelle &>.nixos-switch-log || (
cat nixos-switch.log | grep --color error && false) cat nixos-switch.log | grep --color error && false)