Refactor the sudo configuration script

This commit is contained in:
Manuel Thalmann 2024-09-19 21:23:16 +02:00
parent 1095853916
commit fb2ff92b73
5 changed files with 19 additions and 4 deletions

View file

@ -11,7 +11,7 @@ begin
end end
function installValhallaDeps -V mountDir function installValhallaDeps -V mountDir
pacstrap -K "$mountDir" fish git jq nix tmux pacstrap -K "$mountDir" fish git jq nix sudo tmux
end end
function getInstallerScript -V dir -S function getInstallerScript -V dir -S
@ -82,7 +82,6 @@ begin
and arch-chroot "$mountDir" mkinitcpio -P and arch-chroot "$mountDir" mkinitcpio -P
and runHook installDrivers "Installing drivers..." || true and runHook installDrivers "Installing drivers..." || true
and arch-chroot "$mountDir" bash "$tempDir/../Software/sudo/install.sh"
and runInOS fish "$tempDir/../Software/GRUB/main.fish" and runInOS fish "$tempDir/../Software/GRUB/main.fish"
and if set -l keyLayout (getConfig valhalla.keyboardLayout) and if set -l keyLayout (getConfig valhalla.keyboardLayout)

View file

@ -36,6 +36,7 @@ function deploySoftware -d "Deploys a the specified software action" -a action
end end
and source "$dir/../../Common/Software/bash/main.fish" $argv and source "$dir/../../Common/Software/bash/main.fish" $argv
and source "$dir/../Software/sudo/main.fish" $argv
and source "$dir/../Software/openssh/main.fish" $argv and source "$dir/../Software/openssh/main.fish" $argv
and source "$dir/../Software/vim/main.fish" $argv and source "$dir/../Software/vim/main.fish" $argv
and source "$dir/../Software/git/main.fish" $argv and source "$dir/../Software/git/main.fish" $argv

View file

@ -0,0 +1,15 @@
#!/bin/env fish
begin
set -l dir (status dirname)
source "$dir/../../Scripts/software.fish"
function installSW
pacinst sudo
end
function configureSW
echo "%wheel ALL=(ALL:ALL) ALL" | sudo tee /etc/sudoers.d/wheel > /dev/null
end
runInstaller $argv
end

View file

@ -14,7 +14,7 @@ if [ (id -u) -eq 0 ]
--comment "PortValhalla setup user" \ --comment "PortValhalla setup user" \
--system \ --system \
--no-user-group \ --no-user-group \
--groups wheel,nix-users \ --groups nix-users \
--create-home \ --create-home \
--uid (getConfig valhalla.setupUser.id --json) \ --uid (getConfig valhalla.setupUser.id --json) \
"$name" "$name"

View file

@ -18,7 +18,7 @@ function runSetup
if not type -q installValhallaDeps if not type -q installValhallaDeps
function installValhallaDeps function installValhallaDeps
echo 'Please set up the hook `installValhallaDeps` for installing `fish`, `git`, `jq`, `nix` and `tmux`.' echo 'Please set up the hook `installValhallaDeps` for installing `fish`, `git`, `jq`, `nix`, `sudo` and `tmux`.'
exit 1 exit 1
end end
end end