13 lines
325 B
Bash
Executable File
13 lines
325 B
Bash
Executable File
#!/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
|