Skip to content

Commit

Permalink
only support building devbox, add delta package, add homebrew setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mariolopjr committed Jan 25, 2025
1 parent 46a00d7 commit 57cef32
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 8 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/build-devbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ jobs:
id-token: write
strategy:
fail-fast: false
matrix:
containerfile:
- devbox
steps:
# Clone code to runner
- name: Checkout
Expand All @@ -50,8 +47,8 @@ jobs:
uses: redhat-actions/buildah-build@v2
with:
containerfiles: |
./ContainerFiles/${{ matrix.containerfile }}
image: ${{ matrix.containerfile }}
./Containerfile
image: devbox
tags: ${{ env.IMAGE_TAGS }}
labels: ${{ steps.meta.outputs.labels }}
oci: true
Expand Down
10 changes: 7 additions & 3 deletions ContainerFiles/devbox → Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ LABEL com.github.containers.toolbox="true" \
maintainer="mario@techmunchies.net"

# Copy the setup scripts and package list
COPY ../scripts/devbox.sh /
COPY ../scripts/distrobox-shims.sh /
COPY ../packages/devbox.packages /
COPY ./scripts/devbox.sh /
COPY ./scripts/distrobox-shims.sh /
COPY ./packages/devbox.packages /
COPY ./files /

# Run the setup scripts
RUN /devbox.sh
RUN rm /devbox.sh /distrobox-shims.sh /devbox.packages

# linuxbrew setup
RUN mv /home/linuxbrew /home/homebrew
40 changes: 40 additions & 0 deletions files/etc/profile.d/00-brew-first-run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
if test "$(id -u)" -gt "0"; then
blue=$(printf '\033[38;5;32m')
bold=$(printf '\033[1m')
normal=$(printf '\033[0m')

if test ! -d /home/linuxbrew/.linuxbrew; then
name="$(hostname -s)"
linuxbrew_home="${XDG_DATA_HOME:-$HOME/.local/share}"/devbox/"${name}"
printf "Setting up Linuxbrew...\t\t\t\t "
if test ! -d "${linuxbrew_home}"; then
mkdir -p "${linuxbrew_home}"
if test -d "${XDG_DATA_HOME:-$HOME/.local/share}"/devbox/.linuxbrew; then
mv "${XDG_DATA_HOME:-$HOME/.local/share}"/devbox/.linuxbrew "${linuxbrew_home}"/.linuxbrew
fi
fi
if test ! -d /home/linuxbrew; then
sudo mkdir -p /home/linuxbrew
fi
sudo mount --bind "${linuxbrew_home}" /home/linuxbrew
sudo cp -R /home/homebrew/.linuxbrew /home/linuxbrew/
sudo chown -R "$(id -u)" /home/linuxbrew
unset linuxbrew_home
printf "%s[ OK ]%s\n" "${blue}" "${normal}"
fi

if test ! -d /usr/local/share/bash-completion/completions; then
printf "Setting up Tab-Completions...\t\t\t "
sudo mkdir -p /usr/local/share/bash-completion
sudo mount --bind /run/host/usr/share/bash-completion /usr/local/share/bash-completion
if test -x /run/host/usr/bin/ujust; then
sudo ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/ujust
fi
printf "%s[ OK ]%s\n" "${blue}" "${normal}"
fi

if test ! -f /etc/linuxbrew.firstrun; then
sudo touch /etc/linuxbrew.firstrun
printf "\nlinuxbrew first run complete!\n\n"
fi
fi
1 change: 1 addition & 0 deletions packages/devbox.packages
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ chezmoi
cosign
ctop
curl
delta
direnv
fd
fish
Expand Down

0 comments on commit 57cef32

Please sign in to comment.