Prevent early disposal

This commit is contained in:
Manuel Thalmann 2024-11-03 23:41:17 +01:00
parent 74b3960a82
commit 0bfa2d4d2d

View file

@ -28,14 +28,13 @@ end
function runSetupUserAction -V dir
source "$dir/nix.fish"
function setupUserAction -V dir -V sudoConfig
if [ (id -u) -eq 0 ]
set -l cmdline (cat /proc/$fish_pid/cmdline | string split0)
if [ -z "$TMUX" ]
tmux new-session $cmdline
else
function setupUserAction -V dir -V sudoConfig -V cmdline
source "$dir/settings.fish"
set -l sudoConfig "/etc/sudoers.d/PortValhalla"
set -l name (getOSConfig setupUser.name)
@ -61,12 +60,11 @@ function runSetupUserAction -V dir
rm "$sudoConfig"
userdel -rf "$name"
end
runAction setupUserAction $argv
uninstallNixPkgs
read -P "setup user action finished. press enter"
end
else
$argv
uninstallNixPkgs
end
end
runAction setupUserAction $argv
end