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

29 lines
567 B
Nix
Raw Normal View History

{
lib,
stdenv,
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!"
'';
}