From 1c452512efd687f0a3eb960bca750776b3c77e9a Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 5 Dec 2024 09:25:52 +0100 Subject: [PATCH] Create function for bootstrapping dependencies --- scripts/Arch/OS/install.fish | 7 +------ scripts/Arch/OS/setup.fish | 5 +++-- scripts/Arch/lib/dependencies.fish | 5 +++++ scripts/Common/OS/setup.fish | 1 + 4 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 scripts/Arch/lib/dependencies.fish diff --git a/scripts/Arch/OS/install.fish b/scripts/Arch/OS/install.fish index 69faf9ed..4507cd4b 100755 --- a/scripts/Arch/OS/install.fish +++ b/scripts/Arch/OS/install.fish @@ -1,12 +1,7 @@ #!/bin/env fish begin set -l dir (status dirname) - - function installValhallaDeps -V dir - source "$dir/../lib/software.fish" - and pacinst fish git jq nix sudo tmux - sudo systemctl enable --now nix-daemon - end + source "$dir/../lib/dependencies.fish" function getDeploymentScript -V dir echo "$dir/../lib/deploy.fish" diff --git a/scripts/Arch/OS/setup.fish b/scripts/Arch/OS/setup.fish index 6b23f877..30ac8826 100755 --- a/scripts/Arch/OS/setup.fish +++ b/scripts/Arch/OS/setup.fish @@ -1,6 +1,7 @@ #!/bin/env fish begin set -l dir (status dirname) + source "$dir/../lib/dependencies.fish" source "$dir/../../Common/OS/setup.fish" source "$dir/../../lib/settings.fish" @@ -8,8 +9,8 @@ begin arch-chroot $argv end - function installValhallaDeps -S - pacstrap -K "$mountDir" fish git jq nix sudo tmux + function bootstrapSetup -S + pacstrap -K "$mountDir" fish end function installDrivers -S diff --git a/scripts/Arch/lib/dependencies.fish b/scripts/Arch/lib/dependencies.fish new file mode 100644 index 00000000..c42f36ba --- /dev/null +++ b/scripts/Arch/lib/dependencies.fish @@ -0,0 +1,5 @@ +function installValhallaDeps -V dir + source "$dir/../lib/software.fish" + and pacinst fish git jq nix sudo tmux + sudo systemctl enable --now nix-daemon +end diff --git a/scripts/Common/OS/setup.fish b/scripts/Common/OS/setup.fish index 70ada965..a1bf1295 100755 --- a/scripts/Common/OS/setup.fish +++ b/scripts/Common/OS/setup.fish @@ -51,6 +51,7 @@ function runSetup and echo "Cloning project..." and source "$dir/../../lib/copy-repo.fish" "$mountDir$PROJECT_CLONE_ROOT" runChroot "$mountDir" git config --system --add safe.directory "$PROJECT_CLONE_ROOT" + and runHook --force bootstrapSetup "Please set up a function `bootstrapSetup` for installing `fish` into the " and runHook setupOS and echo "Preparing auto-login..."