diff --git a/pkgs/rebuild/default.nix b/pkgs/rebuild/default.nix index b7d63b6..b51433f 100644 --- a/pkgs/rebuild/default.nix +++ b/pkgs/rebuild/default.nix @@ -11,7 +11,7 @@ writeShellApplication text = '' # A rebuild script for NixOS - rebuild_function (){ + rebuild_function () { set -e pushd /tmp > /dev/null rm -rf ./rebuild @@ -25,6 +25,7 @@ writeShellApplication popd > /dev/null echo "NixOS Rebuilt OK!" } + sudo bash -c "$(declare -f rebuild_function); rebuild_function" sudo systemd-inhibit --who="NixOS Updater" --why="Updating system configuration" sudo -u lillian rebuild_function ''; }