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
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
platforms: linux/amd64,linux/arm64
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
context: "{{defaultContext}}:${{ matrix.box.path }}"
|
||||
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
|
||||
RUN apk update && apk upgrade && \
|
||||
apk add --no-cache \
|
||||
neovim \
|
||||
git \
|
||||
lazygit \
|
||||
zsh \
|
||||
# setup cargo packages, prefer to use apk packages
|
||||
# to reduce build time and space
|
||||
RUN --mount=type=cache,target=/app/target/ \
|
||||
--mount=type=cache,target=/usr/local/cargo/git/db \
|
||||
--mount=type=cache,target=/usr/local/cargo/registry/ \
|
||||
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash \
|
||||
&& 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 \
|
||||
wget \
|
||||
ripgrep \
|
||||
eza \
|
||||
fd \
|
||||
fzf \
|
||||
alpine-sdk \
|
||||
build-base \
|
||||
python3 \
|
||||
py3-pip \
|
||||
openssh
|
||||
gcc \
|
||||
git \
|
||||
just \
|
||||
lazygit \
|
||||
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
|
||||
ENV EDITOR=nvim \
|
||||
|
|
@ -24,18 +52,14 @@ ENV EDITOR=nvim \
|
|||
TERM=xterm-256color \
|
||||
LANG=en_US.UTF-8 \
|
||||
LC_ALL=en_US.UTF-8 \
|
||||
SHELL=/bin/zsh
|
||||
SHELL=/usr/bin/zsh
|
||||
|
||||
# Install and initialize chezmoi
|
||||
RUN sh -c "$(curl -fsLS get.chezmoi.io)" -- -b /usr/local/bin && \
|
||||
mkdir -p ~/.local/share/chezmoi
|
||||
|
||||
RUN chsh -s /bin/zsh
|
||||
|
||||
RUN mkdir -p /workspace
|
||||
|
||||
WORKDIR /workspace
|
||||
# Basic setup
|
||||
RUN \
|
||||
# chsh -s /usr/bin/nu \
|
||||
chsh -s /usr/bin/zsh \
|
||||
&& chmod +x /usr/local/bin/*
|
||||
|
||||
# Build commands:
|
||||
# Docker: docker build -t dev-env .
|
||||
# Podman: podman build -t dev-env .
|
||||
# Docker: docker build -t devbox .
|
||||
# Podman: podman build -t devbox .
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
[devbox]
|
||||
image=devbox:latest
|
||||
image=git.alecodes.page/alecodes/devbox:latest
|
||||
|
||||
replace=true
|
||||
pull=false
|
||||
init=true
|
||||
unshare_all=true
|
||||
root=false
|
||||
start_now=true
|
||||
|
||||
additional_packages="git neovim"
|
||||
|
||||
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