14 lines
447 B
Bash
Executable File
14 lines
447 B
Bash
Executable File
sudo emacs /etc/nixos/configuration.nix -nw
|
|
sudo nixos-rebuild switch &>nixos-switch.log || (
|
|
cat nixos-switch.log | grep --color error && false)
|
|
gen=$(nixos-rebuild list-generations | grep current)
|
|
sudo cp /etc/nixos/configuration.nix .
|
|
git add .
|
|
git commit -m "$gen"
|
|
if (cat nixos-switch.log | grep error = ""); then
|
|
git push
|
|
else
|
|
echo "\033[0;31m There was an error in your Nix Config, please fix it before you push to git \033[0m
|
|
fi
|
|
|