15 lines
394 B
Bash
Executable File
15 lines
394 B
Bash
Executable File
sudo emacs /etc/nixos/configuration.nix
|
|
sudo nixos-rebuild switch &>nixos-switch.log || (
|
|
cat nixos-switch.log | grep --color error && false)
|
|
gen=$(nixos-rebuild list-generations | grep current)
|
|
log=$(cat nixos-switch.log)
|
|
sudo cp /etc/nixos/configuration.nix .
|
|
git add .
|
|
git commit -m "$gen"
|
|
if ($log | grep error); then
|
|
echo "There was an error in your Nix Config"
|
|
else
|
|
git push
|
|
fi
|
|
|