Add a hook for installing dependencies

This commit is contained in:
Manuel Thalmann 2024-07-16 22:16:21 +02:00
parent 5aa296ca7c
commit 2674c93f68
2 changed files with 12 additions and 0 deletions

View file

@ -11,6 +11,10 @@ begin
arch-chroot $argv arch-chroot $argv
end end
function installValhallaDeps -V mountDir
pacstrap -K "$mountDir" fish jq nix tmux
end
function setupOS -S -V dir -V CONFIG_MODULE -V mountDir function setupOS -S -V dir -V CONFIG_MODULE -V mountDir
source "$dir/../../Common/Scripts/wait-network.fish" source "$dir/../../Common/Scripts/wait-network.fish"
source "$dir/../../Common/Scripts/hooks.fish" source "$dir/../../Common/Scripts/hooks.fish"

View file

@ -16,6 +16,13 @@ function runSetup
end end
end end
if not type -q installValhallaDeps
function installValhallaDeps
echo 'Please set up the hook `installValhallaDeps` for installing `fish`, `nix` and `tmux`.'
exit 1
end
end
function getCloneFile -S -a path function getCloneFile -S -a path
set -l relativeDir (realpath --relative-to "$projectRoot" "$dir") set -l relativeDir (realpath --relative-to "$projectRoot" "$dir")
set -l relativePath (realpath --relative-to "$dir" "$path") set -l relativePath (realpath --relative-to "$dir" "$path")
@ -47,6 +54,7 @@ function runSetup
cp -r "$channelDir" "$mountDir/$channelDir" cp -r "$channelDir" "$mountDir/$channelDir"
end end
and runHook installValhallaDeps
and source "$dir/../../copy-repo.fish" "$mountDir$PROJECT_CLONE_ROOT" and source "$dir/../../copy-repo.fish" "$mountDir$PROJECT_CLONE_ROOT"
and runHook setupOS || true and runHook setupOS || true
and runHook autologin || true and runHook autologin || true