NixOS-Config/pkgs/rebuild-no-inhibit/default.nix

25 lines
545 B
Nix

{writeShellApplication}:
writeShellApplication
{
name = "rebuild-no-inhibit";
runtimeInputs = [];
text = ''
# A rebuild script for NixOS
set -e
pushd /tmp > /dev/null
rm -rf ./rebuild
git clone https://codeberg.org/Lillian-Violet/NixOS-Config.git ./rebuild
pushd ./rebuild > /dev/null
echo "NixOS Rebuilding..."
sudo nixos-rebuild switch --flake .#
popd > /dev/null
echo "Cleaning up repository in '/tmp/rebuild'..."
rm -rf ./rebuild
popd > /dev/null
echo "NixOS Rebuilt OK!"
'';
}