Add systemd inhibit to the rebuild and install scripts so they cannot be interrupted normally

This commit is contained in:
Lillian Violet 2024-02-29 16:32:13 +01:00
parent f61a944dd1
commit 19579c43c7
2 changed files with 7 additions and 7 deletions

View file

@ -13,8 +13,8 @@ writeShellApplication
# An install script for NixOS installation to /tmp
set -e
pushd /tmp > /dev/null
rm -rf ./install-nix
git clone https://git.lillianviolet.dev/Lillian-Violet/NixOS-Config.git ./install-nix
systemd-inhibit rm -rf ./install-nix
systemd-inhibit git clone https://git.lillianviolet.dev/Lillian-Violet/NixOS-Config.git ./install-nix
pushd ./install-nix/nixos/hosts > /dev/null
echo "Please choose the hostname you are installing to from the following list:"
i=1
@ -26,10 +26,10 @@ writeShellApplication
popd > /dev/null
pushd ./install-nix > /dev/null
echo "NixOS Installing..."
sudo nixos-install --flake .#"''${dir}"
systemd-inhibit sudo nixos-install --flake .#"''${dir}"
popd > /dev/null
echo "Cleaning up repository in '/tmp/install-nix'..."
rm -rf ./install-nix
systemd-inhibit rm -rf ./install-nix
popd > /dev/null
notify-send -e "NixOS Install Succeeded!" --icon=software-update-available
'';

View file

@ -14,13 +14,13 @@ writeShellApplication
set -e
pushd /tmp > /dev/null
rm -rf ./rebuild
git clone https://git.lillianviolet.dev/Lillian-Violet/NixOS-Config.git ./rebuild
systemd-inhibit git clone https://git.lillianviolet.dev/Lillian-Violet/NixOS-Config.git ./rebuild
pushd ./rebuild > /dev/null
echo "NixOS Rebuilding..."
sudo nixos-rebuild switch --flake .#
systemd-inhibit sudo nixos-rebuild switch --flake .#
popd > /dev/null
echo "Cleaning up repository in '/tmp/rebuild'..."
rm -rf ./rebuild
systemd-inhibit rm -rf ./rebuild
popd > /dev/null
notify-send -e "NixOS Rebuilt OK!" --icon=software-update-available
'';