39 current 2025-10-04 16:06:58 25.05.20251001.5b5be50 6.12.49 *

This commit is contained in:
2025-10-04 16:12:50 -05:00
parent 889e8ba0c4
commit 440cf4f889
2 changed files with 7 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
# flake for blakes nixos config
# define new devices in outputs
# generation: 38
# generation: 39 current 2025-10-04 16:06:58 25.05.20251001.5b5be50 6.12.49 *

View File

@@ -8,6 +8,12 @@ git diff -U0 $(find . -name '*.nix')
# add generation comment to flake.nix
gen=$(nixos-rebuild list-generations | grep current | awk '{print $1}')
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)
if sed -n '3p' flake.nix | grep -q '^# generation:'; then
# replace the comment on line 3
sed -i "3s/^# generation:.*/# generation: $gen/" flake.nix
@@ -16,9 +22,5 @@ else
sed -i "3i# generation: $gen" flake.nix
fi
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