Skip to content

Commit

Permalink
sandbox: add passing through of helix config if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
ahayzen committed Dec 2, 2024
1 parent 3ebaf1e commit 5f589af
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ PROJECT_FILES=(
"src/sandbox/git.sh"
"src/sandbox/gpu.sh"
"src/sandbox/group.sh"
"src/sandbox/helix.sh"
"src/sandbox/input.sh"
"src/sandbox/kvm.sh"
"src/sandbox/name.sh"
Expand Down
15 changes: 15 additions & 0 deletions src/sandbox/helix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# SPDX-FileCopyrightText: Andrew Hayzen <ahayzen@gmail.com>
#
# SPDX-License-Identifier: MPL-2.0

function sandbox_setup_helix() {
# If there is a helix config then mount it into the container
if [ -d "$HOME/.config/helix" ]; then
# Ensure parent of mounted helix folder exists
# otherwise .config is root in the container
mkdir -p "$PERSIST_FOLDER/home/.config/"

CONTAINER_RUN_ARGS+=(--volume="$HOME/.config/helix":"$HOME/.config/helix":ro)
fi
}

2 changes: 2 additions & 0 deletions src/sandbox/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ function sandbox_setup() {
sandbox_setup_gpu
printf "\r(%s) Finding group ... " "$TAG_NAME"
sandbox_setup_group
printf "\r(%s) Finding helix ..." "$TAG_NAME"
sandbox_setup_helix
printf "\r(%s) Finding input ..." "$TAG_NAME"
sandbox_setup_input
printf "\r(%s) Finding KVM ... " "$TAG_NAME"
Expand Down

0 comments on commit 5f589af

Please sign in to comment.