add comment to flake.nix w/ gen #
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user