39 current 2025-10-04 16:06:58 25.05.20251001.5b5be50 6.12.49 *
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# flake for blakes nixos config
|
# flake for blakes nixos config
|
||||||
# define new devices in outputs
|
# define new devices in outputs
|
||||||
# generation: 38
|
# generation: 39 current 2025-10-04 16:06:58 25.05.20251001.5b5be50 6.12.49 *
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
10
rebuild.sh
10
rebuild.sh
@@ -8,6 +8,12 @@ git diff -U0 $(find . -name '*.nix')
|
|||||||
|
|
||||||
# add generation comment to flake.nix
|
# add generation comment to flake.nix
|
||||||
gen=$(nixos-rebuild list-generations | grep current | awk '{print $1}')
|
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
|
if sed -n '3p' flake.nix | grep -q '^# generation:'; then
|
||||||
# replace the comment on line 3
|
# replace the comment on line 3
|
||||||
sed -i "3s/^# generation:.*/# generation: $gen/" flake.nix
|
sed -i "3s/^# generation:.*/# generation: $gen/" flake.nix
|
||||||
@@ -16,9 +22,5 @@ else
|
|||||||
sed -i "3i# generation: $gen" flake.nix
|
sed -i "3i# generation: $gen" flake.nix
|
||||||
fi
|
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"
|
git commit -am "$gen"
|
||||||
popd
|
popd
|
||||||
|
|||||||
Reference in New Issue
Block a user