Need elevated privileges for normal inhibit, let's try what=idle instead

This commit is contained in:
Lillian Violet 2024-02-29 16:47:41 +01:00
parent 19579c43c7
commit 7aa0405738
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
systemd-inhibit rm -rf ./install-nix
systemd-inhibit git clone https://git.lillianviolet.dev/Lillian-Violet/NixOS-Config.git ./install-nix
systemd-inhibit --what=idle rm -rf ./install-nix
systemd-inhibit --what=idle 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..."
systemd-inhibit sudo nixos-install --flake .#"''${dir}"
systemd-inhibit --what=idle sudo nixos-install --flake .#"''${dir}"
popd > /dev/null
echo "Cleaning up repository in '/tmp/install-nix'..."
systemd-inhibit rm -rf ./install-nix
systemd-inhibit --what=idle 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
systemd-inhibit git clone https://git.lillianviolet.dev/Lillian-Violet/NixOS-Config.git ./rebuild
systemd-inhibit --what=idle git clone https://git.lillianviolet.dev/Lillian-Violet/NixOS-Config.git ./rebuild
pushd ./rebuild > /dev/null
echo "NixOS Rebuilding..."
systemd-inhibit sudo nixos-rebuild switch --flake .#
systemd-inhibit --what=idle sudo nixos-rebuild switch --flake .#
popd > /dev/null
echo "Cleaning up repository in '/tmp/rebuild'..."
systemd-inhibit rm -rf ./rebuild
systemd-inhibit --what=idle rm -rf ./rebuild
popd > /dev/null
notify-send -e "NixOS Rebuilt OK!" --icon=software-update-available
'';