Compare commits
7 commits
ostree/riv
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| e786036a4b | |||
| 5eb1cb2618 | |||
| 6aaf6e7842 | |||
| e05f690b61 | |||
| 690d9d3f6b | |||
| 48d623b989 | |||
| 19fbdc6834 |
6 changed files with 118 additions and 32 deletions
|
|
@ -65,7 +65,7 @@ jobs:
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64
|
||||||
push: true
|
push: true
|
||||||
context: "{{defaultContext}}:${{ matrix.box.path }}"
|
context: "{{defaultContext}}:${{ matrix.box.path }}"
|
||||||
tags: |
|
tags: |
|
||||||
|
|
|
||||||
21
boxes/devbox/.justfile
Normal file
21
boxes/devbox/.justfile
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
clean := "false"
|
||||||
|
box_name := file_stem(invocation_directory())
|
||||||
|
|
||||||
|
unexport GOBIN
|
||||||
|
unexport GOPATH
|
||||||
|
unexport GOROOT
|
||||||
|
|
||||||
|
|
||||||
|
# Create a new box from current directory
|
||||||
|
[no-cd]
|
||||||
|
build box_name:
|
||||||
|
[[ "{{clean}}" == "true" ]] && sudo rm -rf ${HOME}/chroots/{{ box_name }} || true
|
||||||
|
|
||||||
|
podman build -t {{box_name}}:latest .
|
||||||
|
|
||||||
|
distrobox assemble create
|
||||||
|
|
||||||
|
# Enter the box
|
||||||
|
enter box_name:
|
||||||
|
clear
|
||||||
|
@distrobox enter --clean-path --no-workdir {{box_name}}
|
||||||
|
|
@ -1,22 +1,50 @@
|
||||||
FROM quay.io/toolbx-images/alpine-toolbox:edge
|
FROM rust:latest AS rust-builder
|
||||||
|
|
||||||
# Update system and install packages
|
# setup cargo packages, prefer to use apk packages
|
||||||
RUN apk update && apk upgrade && \
|
# to reduce build time and space
|
||||||
apk add --no-cache \
|
RUN --mount=type=cache,target=/app/target/ \
|
||||||
neovim \
|
--mount=type=cache,target=/usr/local/cargo/git/db \
|
||||||
git \
|
--mount=type=cache,target=/usr/local/cargo/registry/ \
|
||||||
lazygit \
|
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash \
|
||||||
zsh \
|
&& cargo binstall --no-confirm \
|
||||||
|
dotter
|
||||||
|
|
||||||
|
FROM ghcr.io/void-linux/void-glibc-full:latest
|
||||||
|
|
||||||
|
# Setup void packages
|
||||||
|
RUN --mount=type=cache,target=/var/cache/xbps/ \
|
||||||
|
xbps-install -Syu \
|
||||||
|
&& xbps-install -Sy \
|
||||||
|
bash \
|
||||||
|
bat \
|
||||||
|
cocogitto \
|
||||||
curl \
|
curl \
|
||||||
wget \
|
eza \
|
||||||
ripgrep \
|
|
||||||
fd \
|
fd \
|
||||||
fzf \
|
fzf \
|
||||||
alpine-sdk \
|
gcc \
|
||||||
build-base \
|
git \
|
||||||
python3 \
|
just \
|
||||||
py3-pip \
|
lazygit \
|
||||||
openssh
|
neovim \
|
||||||
|
nodejs \
|
||||||
|
ripgrep \
|
||||||
|
sd \
|
||||||
|
starship \
|
||||||
|
tealdeer \
|
||||||
|
tmux \
|
||||||
|
tree-sitter \
|
||||||
|
void-repo-multilib \
|
||||||
|
void-repo-multilib-nonfree \
|
||||||
|
void-repo-nonfree \
|
||||||
|
yazi \
|
||||||
|
zoxide \
|
||||||
|
zsh
|
||||||
|
|
||||||
|
# Import cargo packages
|
||||||
|
COPY --from=rust-builder /usr/local/cargo/bin/* /usr/local/bin/
|
||||||
|
|
||||||
|
COPY ./scripts/* /usr/local/bin/
|
||||||
|
|
||||||
# Set environment variables
|
# Set environment variables
|
||||||
ENV EDITOR=nvim \
|
ENV EDITOR=nvim \
|
||||||
|
|
@ -24,18 +52,14 @@ ENV EDITOR=nvim \
|
||||||
TERM=xterm-256color \
|
TERM=xterm-256color \
|
||||||
LANG=en_US.UTF-8 \
|
LANG=en_US.UTF-8 \
|
||||||
LC_ALL=en_US.UTF-8 \
|
LC_ALL=en_US.UTF-8 \
|
||||||
SHELL=/bin/zsh
|
SHELL=/usr/bin/zsh
|
||||||
|
|
||||||
# Install and initialize chezmoi
|
# Basic setup
|
||||||
RUN sh -c "$(curl -fsLS get.chezmoi.io)" -- -b /usr/local/bin && \
|
RUN \
|
||||||
mkdir -p ~/.local/share/chezmoi
|
# chsh -s /usr/bin/nu \
|
||||||
|
chsh -s /usr/bin/zsh \
|
||||||
RUN chsh -s /bin/zsh
|
&& chmod +x /usr/local/bin/*
|
||||||
|
|
||||||
RUN mkdir -p /workspace
|
|
||||||
|
|
||||||
WORKDIR /workspace
|
|
||||||
|
|
||||||
# Build commands:
|
# Build commands:
|
||||||
# Docker: docker build -t dev-env .
|
# Docker: docker build -t devbox .
|
||||||
# Podman: podman build -t dev-env .
|
# Podman: podman build -t devbox .
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,16 @@
|
||||||
[devbox]
|
[devbox]
|
||||||
image=devbox:latest
|
image=git.alecodes.page/alecodes/devbox:latest
|
||||||
|
|
||||||
replace=true
|
replace=true
|
||||||
pull=false
|
pull=false
|
||||||
init=true
|
init=true
|
||||||
unshare_all=true
|
|
||||||
root=false
|
root=false
|
||||||
start_now=true
|
start_now=true
|
||||||
|
|
||||||
additional_packages="git neovim"
|
|
||||||
|
|
||||||
home="${HOME}/chroots/devbox"
|
home="${HOME}/chroots/devbox"
|
||||||
|
volume="${HOME}/.ssh:${HOME}/chroots/devbox/.ssh"
|
||||||
|
|
||||||
|
additional_packages=""
|
||||||
|
additional_flags="--hostname devbox"
|
||||||
|
|
||||||
|
init_hooks=if [ -e /usr/local/bin/fetch_dots ]; then sudo -u aleidk sh -c "/usr/local/bin/fetch_dots" && rm /usr/local/bin/fetch_dots; fi
|
||||||
|
|
|
||||||
28
boxes/devbox/scripts/fetch_dots
Normal file
28
boxes/devbox/scripts/fetch_dots
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e pipefail
|
||||||
|
|
||||||
|
base_dir="$HOME/Repos/Private/"
|
||||||
|
|
||||||
|
mkdir -p "$base_dir"
|
||||||
|
|
||||||
|
cd "$base_dir" || exit
|
||||||
|
|
||||||
|
if [ -d dots ]; then
|
||||||
|
echo "Dots already exists, updating..."
|
||||||
|
cd dots || exit
|
||||||
|
git pull --rebase --autostash
|
||||||
|
|
||||||
|
else
|
||||||
|
git clone ssh://git@git.alecodes.page:24062/alecodes/dots.git
|
||||||
|
|
||||||
|
cd dots || exit
|
||||||
|
|
||||||
|
git checkout dotter-migration
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Fixing permissions..."
|
||||||
|
chown -R 1000:1000 "$base_dir"
|
||||||
|
|
||||||
|
echo "Deploying dots..."
|
||||||
|
dotter deploy
|
||||||
10
boxes/devbox/scripts/setup_go
Normal file
10
boxes/devbox/scripts/setup_go
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e pipefail
|
||||||
|
|
||||||
|
sudo xbps-install -Sy go
|
||||||
|
|
||||||
|
go install mvdan.cc/gofumpt@latest
|
||||||
|
go install -v github.com/incu6us/goimports-reviser/v3@latest
|
||||||
|
go install github.com/segmentio/golines@latest
|
||||||
|
go install golang.org/x/tools/gopls@latest
|
||||||
Loading…
Add table
Add a link
Reference in a new issue