Add function for inheriting fish installers

This commit is contained in:
Manuel Thalmann 2024-10-12 01:54:31 +02:00
parent d1076f9b2d
commit 4504ca85d4
20 changed files with 53 additions and 97 deletions

View file

@ -2,14 +2,11 @@
begin begin
set -l dir (status dirname) set -l dir (status dirname)
source "$dir/../../Scripts/software.fish" source "$dir/../../Scripts/software.fish"
inherit "$dir/../../../Common/Software/Firefox/main.fish"
function installSW -V dir function installSW -V dir
yayinst firefox yayinst firefox
end end
function configureSW -V dir
fish "$dir/../../../Common/Software/Firefox/main.fish" configure
end
runInstaller $argv runInstaller $argv
end end

View file

@ -2,14 +2,13 @@
begin begin
set -l dir (status dirname) set -l dir (status dirname)
source "$dir/../../Scripts/software.fish" source "$dir/../../Scripts/software.fish"
inherit "$dir/../../../Common/Software/GRUB/main.fish"
function installSW -V dir function installSW -V dir
pacinst \ pacinst \
grub \ grub \
efibootmgr \ efibootmgr \
os-prober os-prober
fish "$dir/../../../Common/Software/GRUB/main.fish" configure
end end
runInstaller $argv runInstaller $argv

View file

@ -1,20 +1,12 @@
#!/bin/env fish #!/bin/env fish
begin begin
set -l dir (status dirname) set -l dir (status dirname)
set -l base "$dir/../../../Common/Software/Oh My Posh/main.fish"
source "$dir/../../Scripts/software.fish" source "$dir/../../Scripts/software.fish"
inherit "$dir/../../../Common/Software/Oh My Posh/main.fish"
function installSW function installSW
yayinst oh-my-posh-bin yayinst oh-my-posh-bin
end end
function configureSW -V base
fish "$base" configure
end
function userConfig -S -V base -a name
fish "$base" userConfig $argv
end
runInstaller $argv runInstaller $argv
end end

View file

@ -2,14 +2,11 @@
begin begin
set -l dir (status dirname) set -l dir (status dirname)
source "$dir/../../Scripts/software.fish" source "$dir/../../Scripts/software.fish"
inherit "$dir/../../../Common/Software/PowerShell/main.fish"
function installSW function installSW
yayinst powershell-bin yayinst powershell-bin
end end
function configureSW -V dir
fish "$dir/../../../Common/Software/PowerShell/main.fish" configure
end
runInstaller $argv runInstaller $argv
end end

View file

@ -1,8 +1,8 @@
#!/bin/env fish #!/bin/env fish
begin begin
set -l dir (status dirname) set -l dir (status dirname)
set -l base "$dir/../../../Common/Software/Virtual Machine Manager/main.fish"
source "$dir/../../Scripts/software.fish" source "$dir/../../Scripts/software.fish"
inherit "$dir/../../../Common/Software/Virtual Machine Manager/main.fish"
function installSW function installSW
yayinst qemu-full yayinst qemu-full
@ -17,14 +17,10 @@ begin
virt-bootstrap-git virt-bootstrap-git
end end
function configureSW -V base function configureSW
sudo systemctl enable --now libvirtd sudo systemctl enable --now libvirtd
sudo systemctl enable --now virtlogd sudo systemctl enable --now virtlogd
fish "$base" configure configureSWBase $argv
end
function userConfig -V base
fish "$base" userConfig $argv
end end
runInstaller $argv runInstaller $argv

View file

@ -1,21 +1,13 @@
#!/bin/env fish #!/bin/env fish
begin begin
set -l dir (status dirname) set -l dir (status dirname)
set -l base "$dir/../../../Common/Software/aliae/main.fish"
source "$dir/../../Scripts/software.fish" source "$dir/../../Scripts/software.fish"
inherit "$dir/../../../Common/Software/aliae/main.fish"
function installSW function installSW
yayinst \ yayinst \
aliae-bin aliae-bin
end end
function configureSW -V base
fish "$base" configure
end
function userConfig -V base
fish "$base" userConfig $argv
end
runInstaller $argv runInstaller $argv
end end

View file

@ -2,6 +2,7 @@
begin begin
set -l dir (status dirname) set -l dir (status dirname)
source "$dir/../../Scripts/software.fish" source "$dir/../../Scripts/software.fish"
inherit "$dir/../../../Common/Software/brave/main.fish"
function installSW function installSW
yayinst brave-bin ( yayinst brave-bin (
@ -10,9 +11,5 @@ begin
) )
end end
function configureSW -V dir
fish "$dir/../../../Common/Software/brave/main.fish" configure
end
runInstaller $argv runInstaller $argv
end end

View file

@ -1,8 +1,8 @@
#!/bin/env fish #!/bin/env fish
begin begin
set -l dir (status dirname) set -l dir (status dirname)
set -l base "$dir/../../../Common/Software/docker/main.fish"
source "$dir/../../Scripts/software.fish" source "$dir/../../Scripts/software.fish"
inherit "$dir/../../../Common/Software/docker/main.fish"
function installSW function installSW
yayinst \ yayinst \
@ -12,13 +12,5 @@ begin
docker-scan docker-scan
end end
function configureSW -V base
fish "$base" configure
end
function userConfig -V base
fish "$base" userConfig $argv
end
runInstaller $argv runInstaller $argv
end end

View file

@ -1,8 +1,8 @@
#!/bin/env fish #!/bin/env fish
begin begin
set -l dir (status dirname) set -l dir (status dirname)
set -l base "$dir/../../../Common/Software/git/main.fish"
source "$dir/../../Scripts/software.fish" source "$dir/../../Scripts/software.fish"
inherit "$dir/../../../Common/Software/git/main.fish"
function installSW function installSW
yayinst \ yayinst \
@ -14,13 +14,5 @@ begin
gitflow-zshcompletion-avh gitflow-zshcompletion-avh
end end
function configureSW -V base
fish "$base" configure
end
function userConfig -V base
fish "$base" userConfig $argv
end
runInstaller $argv runInstaller $argv
end end

View file

@ -2,6 +2,7 @@
begin begin
set -l dir (status dirname) set -l dir (status dirname)
source "$dir/../../Scripts/software.fish" source "$dir/../../Scripts/software.fish"
inherit "$dir/../../../Common/Software/logo-ls/main.fish"
function installSW -V dir function installSW -V dir
set -l dirName (realpath "$dir") set -l dirName (realpath "$dir")
@ -34,9 +35,5 @@ begin
end end
end end
function configureSW -V dir
fish "$dir/../../../Common/Software/logo-ls/main.fish" configure
end
runInstaller $argv runInstaller $argv
end end

View file

@ -2,14 +2,11 @@
begin begin
set -l dir (status dirname) set -l dir (status dirname)
source "$dir/../../Scripts/software.fish" source "$dir/../../Scripts/software.fish"
inherit "$dir/../../../Common/Software/minegrub-theme/main.fish"
function installSW function installSW
yayinst grub-theme-minegrub-git yayinst grub-theme-minegrub-git
end end
function configureSW -V dir
fish "$dir/../../../Common/Software/minegrub-theme/main.fish" configure
end
runInstaller $argv runInstaller $argv
end end

View file

@ -2,6 +2,7 @@
begin begin
set -l dir (status dirname) set -l dir (status dirname)
source "$dir/../../Scripts/software.fish" source "$dir/../../Scripts/software.fish"
inherit "$dir/../../../Common/Software/nix/main.fish"
function installSW function installSW
yayinst \ yayinst \
@ -13,7 +14,7 @@ begin
function configureSW -V dir function configureSW -V dir
sudo systemctl enable --now nix-daemon sudo systemctl enable --now nix-daemon
fish "$dir/../../../Common/Software/nix/main.fish" configure configureSWBase configure $argv
end end
runInstaller $argv runInstaller $argv

View file

@ -2,6 +2,7 @@
begin begin
set -l dir (status dirname) set -l dir (status dirname)
source "$dir/../../Scripts/software.fish" source "$dir/../../Scripts/software.fish"
inherit "$dir/../../../Common/Software/nvidia-dkms/main.fish"
function installSW function installSW
yayinst \ yayinst \
@ -21,7 +22,7 @@ begin
done done
end | sudo tee /etc/mkinitcpio.conf.d/nvidia.conf >/dev/null end | sudo tee /etc/mkinitcpio.conf.d/nvidia.conf >/dev/null
fish "$dir/../../../Common/Software/nvidia-dkms/main.fish" configure configureSWBase $argv
end end
runInstaller $argv runInstaller $argv

View file

@ -2,14 +2,11 @@
begin begin
set -l dir (status dirname) set -l dir (status dirname)
source "$dir/../../Scripts/software.fish" source "$dir/../../Scripts/software.fish"
inherit "$dir/../../../Common/Software/pyenv/main.fish"
function installSW function installSW
yayinst pyenv yayinst pyenv
end end
function configureSW -V dir
fish "$dir/../../../Common/Software/pyenv/main.fish" configure
end
runInstaller $argv runInstaller $argv
end end

View file

@ -1,21 +1,13 @@
#!/bin/env fish #!/bin/env fish
begin begin
set -l dir (status dirname) set -l dir (status dirname)
set -l base "$dir/../../../Common/Software/rclone/main.fish"
source "$dir/../../Scripts/software.fish" source "$dir/../../Scripts/software.fish"
inherit "$dir/../../../Common/Software/rclone/main.fish"
function installSW function installSW
yayinst \ yayinst \
rclone rclone
end end
function configureSW -V base
fish "$base" configure
end
function userConfig -V base -a name
fish "$base" userConfig $argv
end
runInstaller $argv runInstaller $argv
end end

View file

@ -2,6 +2,7 @@
begin begin
set -l dir (status dirname) set -l dir (status dirname)
source "$dir/../../Scripts/software.fish" source "$dir/../../Scripts/software.fish"
inherit "$dir/../../../Common/Software/vim/main.fish"
function installSW function installSW
yayinst ( yayinst (
@ -13,10 +14,5 @@ begin
wl-clipboard wl-clipboard
end end
function configureSW -V dir
fish "$dir/../../../Common/Software/vim/main.fish" configure
end
runInstaller $argv runInstaller $argv
end end

View file

@ -2,15 +2,12 @@
begin begin
set -l dir (status dirname) set -l dir (status dirname)
source "$dir/../../Scripts/software.fish" source "$dir/../../Scripts/software.fish"
inherit "$dir/../../../Common/Software/zoxide/main.fish"
function installSW function installSW
yayinst \ yayinst \
zoxide zoxide
end end
function configureSW -V dir
fish "$dir/../../../Common/Software/zoxide/main.fish" configure
end
runInstaller $argv runInstaller $argv
end end

View file

@ -14,6 +14,28 @@ begin
runPSUserAction "$script" ConfigureUser "$name" runPSUserAction "$script" ConfigureUser "$name"
end end
function inherit -a script -d "Inherits the installer from the specified script."
set -l actions \
installSW \
install \
configureSW \
configure \
userConfig \
userConfig
for i in (seq 1 2 (count $actions))
set -l functionName "$actions[$i]Base"
function $functionName -V script -V actions -V i
fish "$script" $actions[(math $i + 1)] $argv
end
function $actions[$i] -V functionName
$functionName $argv
end
end
end
function runInstaller -V dir -a action function runInstaller -V dir -a action
set -l path (status stack-trace | head -n4 | tail -n1 | string replace --regex -- '^\s*called on line \d+ of file (.*)$' '$1') set -l path (status stack-trace | head -n4 | tail -n1 | string replace --regex -- '^\s*called on line \d+ of file (.*)$' '$1')
set -l name (basename (dirname $path)) set -l name (basename (dirname $path))

View file

@ -1,9 +1,10 @@
#!/bin/env fish #!/bin/env fish
begin begin
set -l dir (status dirname) set -l dir (status dirname)
set -l base "$dir/Manage.ps1"
source "$dir/../../Scripts/software.fish" source "$dir/../../Scripts/software.fish"
function configureSW -V dir function configureSW -V dir -V base
source "$dir/../bash/profile.fish" source "$dir/../bash/profile.fish"
source "$dir/../fish/profile.fish" source "$dir/../fish/profile.fish"
@ -20,11 +21,11 @@ begin
'eval "$(oh-my-posh completion bash)"' 'eval "$(oh-my-posh completion bash)"'
end | installBashProfile oh-my-posh end | installBashProfile oh-my-posh
sudo -HE pwsh "$dir/Manage.ps1" Configure sudo -HE pwsh "$base" Configure
end end
function userConfig -S -V dir -a name function userConfig -S -V base -a name
runPSUserConfig "$dir/Manage.ps1" $name runPSUserConfig "$base" $name
end end
runInstaller $argv runInstaller $argv

View file

@ -1,14 +1,15 @@
#!/bin/env fish #!/bin/env fish
begin begin
set -l dir (status dirname) set -l dir (status dirname)
set -l base "$dir/Manage.ps1"
source "$(status dirname)/../../Scripts/software.fish" source "$(status dirname)/../../Scripts/software.fish"
function configureSW -S -V dir function configureSW -S -V base
pwsh "$dir/Manage.ps1" Configure pwsh "$base" Configure
end end
function userConfig -S -V dir -a name function userConfig -S -V base -a name
runPSUserConfig "$dir/Manage.ps1" $name runPSUserConfig "$base" $name
end end
runInstaller $argv runInstaller $argv