Add systemd inhibit to the rebuild and install scripts so they cannot be interrupted normally
This commit is contained in:
parent
f61a944dd1
commit
19579c43c7
|
@ -13,8 +13,8 @@ writeShellApplication
|
||||||
# An install script for NixOS installation to /tmp
|
# An install script for NixOS installation to /tmp
|
||||||
set -e
|
set -e
|
||||||
pushd /tmp > /dev/null
|
pushd /tmp > /dev/null
|
||||||
rm -rf ./install-nix
|
systemd-inhibit rm -rf ./install-nix
|
||||||
git clone https://git.lillianviolet.dev/Lillian-Violet/NixOS-Config.git ./install-nix
|
systemd-inhibit git clone https://git.lillianviolet.dev/Lillian-Violet/NixOS-Config.git ./install-nix
|
||||||
pushd ./install-nix/nixos/hosts > /dev/null
|
pushd ./install-nix/nixos/hosts > /dev/null
|
||||||
echo "Please choose the hostname you are installing to from the following list:"
|
echo "Please choose the hostname you are installing to from the following list:"
|
||||||
i=1
|
i=1
|
||||||
|
@ -26,10 +26,10 @@ writeShellApplication
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
pushd ./install-nix > /dev/null
|
pushd ./install-nix > /dev/null
|
||||||
echo "NixOS Installing..."
|
echo "NixOS Installing..."
|
||||||
sudo nixos-install --flake .#"''${dir}"
|
systemd-inhibit sudo nixos-install --flake .#"''${dir}"
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
echo "Cleaning up repository in '/tmp/install-nix'..."
|
echo "Cleaning up repository in '/tmp/install-nix'..."
|
||||||
rm -rf ./install-nix
|
systemd-inhibit rm -rf ./install-nix
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
notify-send -e "NixOS Install Succeeded!" --icon=software-update-available
|
notify-send -e "NixOS Install Succeeded!" --icon=software-update-available
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -14,13 +14,13 @@ writeShellApplication
|
||||||
set -e
|
set -e
|
||||||
pushd /tmp > /dev/null
|
pushd /tmp > /dev/null
|
||||||
rm -rf ./rebuild
|
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
|
pushd ./rebuild > /dev/null
|
||||||
echo "NixOS Rebuilding..."
|
echo "NixOS Rebuilding..."
|
||||||
sudo nixos-rebuild switch --flake .#
|
systemd-inhibit sudo nixos-rebuild switch --flake .#
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
echo "Cleaning up repository in '/tmp/rebuild'..."
|
echo "Cleaning up repository in '/tmp/rebuild'..."
|
||||||
rm -rf ./rebuild
|
systemd-inhibit rm -rf ./rebuild
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
notify-send -e "NixOS Rebuilt OK!" --icon=software-update-available
|
notify-send -e "NixOS Rebuilt OK!" --icon=software-update-available
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue