From 2674c93f685a9770c450a998742609eba8557b39 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 16 Jul 2024 22:16:21 +0200 Subject: [PATCH] Add a hook for installing dependencies --- scripts/Arch/OS/setup.fish | 4 ++++ scripts/Common/OS/setup.fish | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/scripts/Arch/OS/setup.fish b/scripts/Arch/OS/setup.fish index e14bef49..2c5d0165 100644 --- a/scripts/Arch/OS/setup.fish +++ b/scripts/Arch/OS/setup.fish @@ -11,6 +11,10 @@ begin arch-chroot $argv end + function installValhallaDeps -V mountDir + pacstrap -K "$mountDir" fish jq nix tmux + end + function setupOS -S -V dir -V CONFIG_MODULE -V mountDir source "$dir/../../Common/Scripts/wait-network.fish" source "$dir/../../Common/Scripts/hooks.fish" diff --git a/scripts/Common/OS/setup.fish b/scripts/Common/OS/setup.fish index 20eb8294..59775979 100644 --- a/scripts/Common/OS/setup.fish +++ b/scripts/Common/OS/setup.fish @@ -16,6 +16,13 @@ function runSetup 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 set -l relativeDir (realpath --relative-to "$projectRoot" "$dir") set -l relativePath (realpath --relative-to "$dir" "$path") @@ -47,6 +54,7 @@ function runSetup cp -r "$channelDir" "$mountDir/$channelDir" end + and runHook installValhallaDeps and source "$dir/../../copy-repo.fish" "$mountDir$PROJECT_CLONE_ROOT" and runHook setupOS || true and runHook autologin || true