add comment to flake.nix w/ gen #
This commit is contained in:
@@ -4,6 +4,14 @@ pushd ~/.nix
|
||||
# nvim flake.nix
|
||||
# alejandra . &>/dev/null
|
||||
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..."
|
||||
sudo nixos-rebuild switch --flake ~/.nix#snowbelle &>.nixos-switch-log || (
|
||||
cat nixos-switch.log | grep --color error && false)
|
||||
|
||||
Reference in New Issue
Block a user