From 08f34186747cc78665c583946649853e3faf06e4 Mon Sep 17 00:00:00 2001 From: blake Date: Sat, 4 Oct 2025 12:35:51 -0500 Subject: [PATCH] add rebuild script --- rebuild.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 rebuild.sh diff --git a/rebuild.sh b/rebuild.sh new file mode 100755 index 0000000..549a094 --- /dev/null +++ b/rebuild.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -e +pushd ~/.nix +nvim flake.nix +alejandra . &>/dev/null +git diff -U0 *.nix +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