Ask for config profile in tmux
This commit is contained in:
parent
6596e9a0b7
commit
7687576dbd
1 changed files with 12 additions and 8 deletions
|
@ -9,23 +9,27 @@ function runActionSetup -V dir
|
|||
and echo "Preparing nix..."
|
||||
and runHook prepareNix || installNixPkgs
|
||||
|
||||
and if [ -z "$CONFIG_NAME" ]
|
||||
selectProfile config
|
||||
set -gx CONFIG_NAME "$config"
|
||||
end
|
||||
|
||||
and echo "Flagging repository as safe..."
|
||||
and sudo git config --system --add safe.directory (realpath "$(status dirname)/../..")
|
||||
and runHook actionPreRun || true
|
||||
end
|
||||
|
||||
function runActionConfigure
|
||||
and if [ -z "$CONFIG_NAME" ]
|
||||
selectProfile config
|
||||
set -x CONFIG_NAME "$config"
|
||||
end
|
||||
end
|
||||
|
||||
function disposeAction
|
||||
and sudo git config remove-section --system safe || true
|
||||
runHook actionPostRun || true
|
||||
and uninstallNixPkgs
|
||||
and sudo git config remove-section --system safe || true
|
||||
end
|
||||
|
||||
function runAction -V dir
|
||||
runActionSetup
|
||||
and runActionConfigure
|
||||
and $argv
|
||||
and disposeAction
|
||||
end
|
||||
|
@ -39,10 +43,11 @@ function runSetupUserAction -V dir
|
|||
tmux new-session -e "CONFIG_NAME=$CONFIG_NAME" $cmdline
|
||||
else
|
||||
source "$dir/settings.fish"
|
||||
runActionConfigure
|
||||
set -l sudoConfig "/etc/sudoers.d/PortValhalla"
|
||||
set -l name (getOSConfig setupUser.name)
|
||||
|
||||
begin
|
||||
and begin
|
||||
echo "Creating setup user"
|
||||
|
||||
and useradd \
|
||||
|
@ -61,7 +66,6 @@ function runSetupUserAction -V dir
|
|||
|
||||
and sudo --preserve-env --set-home --user "$name" $cmdline
|
||||
disposeAction
|
||||
uninstallNixPkgs
|
||||
rm "$sudoConfig"
|
||||
userdel -rf "$name"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue