Skip to content

Commit

Permalink
address shellcheck, add brew
Browse files Browse the repository at this point in the history
  • Loading branch information
mariolopjr committed Jan 29, 2025
1 parent 984bd0c commit 8d00a29
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
7 changes: 5 additions & 2 deletions files/etc/profile.d/00-brew-first-run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

if test "$(id -u)" -gt "0"; then
blue=$(printf '\033[38;5;32m')
bold=$(printf '\033[1m')
Expand All @@ -6,7 +8,7 @@ if test "$(id -u)" -gt "0"; then
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 "
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
Expand All @@ -23,8 +25,9 @@ if test "$(id -u)" -gt "0"; then
printf "%s[ OK ]%s\n" "${blue}" "${normal}"
fi

# TODO: set up fish completions
if test ! -d /usr/local/share/bash-completion/completions; then
printf "Setting up Tab-Completions...\t\t\t "
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
Expand Down
8 changes: 8 additions & 0 deletions files/etc/profile.d/01-add-brew-taps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# install brew taps
brew bundle --no-lock --file=/dev/stdin <<EOF
tap "homebrew/aliases"
tap "homebrew/bundle"
tap "homebrew/services"
EOF
11 changes: 11 additions & 0 deletions files/etc/profile.d/02-install-brew-packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# install brew packages
brew bundle --no-lock --file=/dev/stdin <<EOF
brew "f3"
brew "fisher"
brew "mise"
brew "ncdu"
brew "smartmontools"
brew "wakeonlan"
EOF
3 changes: 1 addition & 2 deletions scripts/devbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ apk update && apk upgrade
grep -v '^#' ./devbox.packages | xargs apk add

# Get Distrobox-host-exec and host-spawn
# TODO: fix shellcheck warnings
git clone https://github.com/89luca89/distrobox.git --single-branch /tmp/distrobox &&
cp /tmp/distrobox/distrobox-host-exec /usr/bin/distrobox-host-exec &&
cp /tmp/distrobox/distrobox-export /usr/bin/distrobox-export &&
cp /tmp/distrobox/distrobox-init /usr/bin/entrypoint &&
curl https://github.com/1player/host-spawn/releases/download/$(cat /tmp/distrobox/distrobox-host-exec | grep host_spawn_version= | cut -d "\"" -f 2)/host-spawn-$(uname -m) -o /usr/bin/host-spawn &&
curl "https://github.com/1player/host-spawn/releases/download/$(grep 'host_spawn_version=' /tmp/distrobox/distrobox-host-exec | cut -d '\"' -f 2)/host-spawn-$(uname -m) -o /usr/bin/host-spawn" &&
chmod +x /usr/bin/host-spawn &&
rm -rf /tmp/distrobox &&
ln -fs /bin/sh /usr/bin/sh
Expand Down

0 comments on commit 8d00a29

Please sign in to comment.