Compare commits

...
Sign in to create a new pull request.

7 commits

Author SHA1 Message Date
e786036a4b
feat: update deploy configuration
All checks were successful
Publish image / Generate job matrices (push) Successful in 8s
Publish image / create-docker-images (map[name:devbox path:boxes/devbox]) (push) Successful in 3m57s
2024-11-13 13:07:20 -03:00
5eb1cb2618
feat: add dotfiles auto setup on box creation
All checks were successful
Publish image / Generate job matrices (push) Successful in 8s
Publish image / create-docker-images (map[name:devbox path:boxes/devbox]) (push) Successful in 3m18s
2024-11-11 16:25:34 -03:00
6aaf6e7842
feat: change devbox to void linux
All checks were successful
Publish image / Generate job matrices (push) Successful in 7s
Publish image / create-docker-images (map[name:devbox path:boxes/devbox]) (push) Successful in 2m27s
2024-11-08 16:35:09 -03:00
e05f690b61
fix: change cargo packages installation
Some checks failed
Publish image / Generate job matrices (push) Successful in 11s
Publish image / create-docker-images (map[name:devbox path:boxes/devbox]) (push) Failing after 31m51s
try to download release biniaries instead of compiling them with the help of carg-binstall
2024-11-08 13:13:43 -03:00
690d9d3f6b
feat: add apk and cargo packages to devbox
Some checks failed
Publish image / Generate job matrices (push) Successful in 10s
Publish image / create-docker-images (map[name:devbox path:boxes/devbox]) (push) Has been cancelled
2024-11-08 10:04:14 -03:00
48d623b989 feat: update devbox config
Some checks failed
Publish image / Generate job matrices (push) Successful in 8s
Publish image / create-docker-images (map[name:devbox path:boxes/devbox]) (push) Failing after 34s
2024-11-07 22:09:33 +00:00
19fbdc6834 feat: update devbox deploy config
All checks were successful
Publish image / Generate job matrices (push) Successful in 9s
Publish image / create-docker-images (map[name:devbox path:boxes/devbox]) (push) Successful in 2m45s
2024-11-06 19:19:54 -03:00
6 changed files with 118 additions and 32 deletions

View file

@ -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
View 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}}

View file

@ -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 .

View file

@ -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

View 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

View 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