2024-03-01 15:19:24 +01:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
writeShellApplication,
|
|
|
|
}:
|
|
|
|
writeShellApplication
|
|
|
|
{
|
|
|
|
name = "systemd-rebuild";
|
|
|
|
|
|
|
|
runtimeInputs = [];
|
|
|
|
|
|
|
|
text = ''
|
|
|
|
# A rebuild script for NixOS for use of the systemd service
|
|
|
|
cd /tmp
|
|
|
|
rm -rf ./rebuild
|
|
|
|
systemd-inhibit git clone https://git.lillianviolet.dev/Lillian-Violet/NixOS-Config.git ./rebuild
|
|
|
|
cd ./rebuild
|
|
|
|
echo "NixOS Rebuilding..."
|
2024-03-01 15:21:29 +01:00
|
|
|
systemd-inhibit nixos-rebuild switch --flake .#
|
2024-03-01 15:19:24 +01:00
|
|
|
echo "Cleaning up repository in '/tmp/rebuild'..."
|
2024-03-01 15:25:41 +01:00
|
|
|
cd ..
|
2024-03-01 15:19:24 +01:00
|
|
|
systemd-inhibit rm -rf ./rebuild
|
|
|
|
echo "NixOS Rebuilt OK!"
|
|
|
|
'';
|
|
|
|
}
|