From 20f45a5cc114e78c784132552caf2c10e10b9357 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 d5e5a5cb..98fad560 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/hooks.fish" source "$dir/../../Common/Scripts/wait-network.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