Skip to content

Commit

Permalink
feat: add go and sysbox
Browse files Browse the repository at this point in the history
  • Loading branch information
hanoii committed Nov 20, 2024
1 parent fe3b22b commit 87bc01a
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .ddev/addon-metadata/pimp-my-shell/manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: pimp-my-shell
repository: .
version: ""
install_date: "2024-11-20T13:44:14-03:00"
install_date: "2024-11-20T18:41:16-03:00"
project_files:
- web-build/Dockerfile.pimp-my-shell
- homeadditions/.bashrc.d/pimp-my-shell.sh
Expand Down
5 changes: 5 additions & 0 deletions .ddev/homeadditions/.bashrc.d/pimp-my-shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ eval "$(starship init bash)"
# https://gist.github.com/AppleBoiy/04a249b6f64fd0fe1744aff759a0563b
alias ls='eza --color=always --group-directories-first --icons'
alias ll='eza -la --icons --octal-permissions --group-directories-first'

# go
export PATH=$PATH:/usr/local/go/bin:~/go/bin
unset GOARCH
unset GOOS
6 changes: 6 additions & 0 deletions .ddev/homeadditions/.config/fish/conf.d/pimp-my-shell.fish
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ function fish_user_key_bindings
fzf --fish | source
end

# go
fish_add_path /usr/local/go/bin
fish_add_path ~/go/bin
set -x GOOS
set -x GOARCH

# z.lua
mkdir -p /mnt/ddev-global-cache/z.lua/$HOSTNAME
set -x _ZL_DATA /mnt/ddev-global-cache/z.lua/$HOSTNAME/.zlua
Expand Down
17 changes: 16 additions & 1 deletion .ddev/web-build/Dockerfile.pimp-my-shell
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ RUN set -eux; \
tar -xzf eza-completions.tar.gz --strip-components=3 -C /usr/share/fish/vendor_completions.d/ ./target/completions-${EZA_VERSION}/eza.fish; \
rm eza-completions.tar.gz;

# go
RUN set -eux; \
GO_VERSION=1.23.3; \
AARCH=$(dpkg --print-architecture); \
wget -q https://go.dev/dl/go${GO_VERSION}.linux-${AARCH}.tar.gz -O go.tar.gz; \
tar -C /usr/local -xzf go.tar.gz; \
rm go.tar.gz;

##
# Tools to install under ddev non-root user
#
Expand All @@ -83,11 +91,18 @@ RUN set -eux; \
fish -c "fisher install IlanCosman/[email protected]"; \
fish -c "fisher install edc/[email protected]"

# bun.sh
# bun.sh - it's installed by on the user as it adds stuff to .bashrc
RUN set -eux; \
BUN_VERSION=1.1.36;/ \
curl -fsSL https://bun.sh/install | bash -s "bun-v${BUN_VERSION}"

# go tools - it's installed on the user so so that bin and pkgs are available on the user's home
RUN set -eux; \
unset GOARCH; \
unset GOOS; \
SYSBOX_VERSION=0.19.0; \
/usr/local/go/bin/go install github.com/skx/sysbox@release-${SYSBOX_VERSION};

# Go back to root
USER root:root

Expand Down
5 changes: 5 additions & 0 deletions homeadditions/.bashrc.d/pimp-my-shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ eval "$(starship init bash)"
# https://gist.github.com/AppleBoiy/04a249b6f64fd0fe1744aff759a0563b
alias ls='eza --color=always --group-directories-first --icons'
alias ll='eza -la --icons --octal-permissions --group-directories-first'

# go
export PATH=$PATH:/usr/local/go/bin:~/go/bin
unset GOARCH
unset GOOS
6 changes: 6 additions & 0 deletions homeadditions/.config/fish/conf.d/pimp-my-shell.fish
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ function fish_user_key_bindings
fzf --fish | source
end

# go
fish_add_path /usr/local/go/bin
fish_add_path ~/go/bin
set -x GOOS
set -x GOARCH

# z.lua
mkdir -p /mnt/ddev-global-cache/z.lua/$HOSTNAME
set -x _ZL_DATA /mnt/ddev-global-cache/z.lua/$HOSTNAME/.zlua
Expand Down
17 changes: 16 additions & 1 deletion web-build/Dockerfile.pimp-my-shell
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ RUN set -eux; \
tar -xzf eza-completions.tar.gz --strip-components=3 -C /usr/share/fish/vendor_completions.d/ ./target/completions-${EZA_VERSION}/eza.fish; \
rm eza-completions.tar.gz;

# go
RUN set -eux; \
GO_VERSION=1.23.3; \
AARCH=$(dpkg --print-architecture); \
wget -q https://go.dev/dl/go${GO_VERSION}.linux-${AARCH}.tar.gz -O go.tar.gz; \
tar -C /usr/local -xzf go.tar.gz; \
rm go.tar.gz;

##
# Tools to install under ddev non-root user
#
Expand All @@ -83,11 +91,18 @@ RUN set -eux; \
fish -c "fisher install IlanCosman/[email protected]"; \
fish -c "fisher install edc/[email protected]"

# bun.sh
# bun.sh - it's installed by on the user as it adds stuff to .bashrc
RUN set -eux; \
BUN_VERSION=1.1.36;/ \
curl -fsSL https://bun.sh/install | bash -s "bun-v${BUN_VERSION}"

# go tools - it's installed on the user so so that bin and pkgs are available on the user's home
RUN set -eux; \
unset GOARCH; \
unset GOOS; \
SYSBOX_VERSION=0.19.0; \
/usr/local/go/bin/go install github.com/skx/sysbox@release-${SYSBOX_VERSION};

# Go back to root
USER root:root

Expand Down

0 comments on commit 87bc01a

Please sign in to comment.