feat: update deploy configuration
This commit is contained in:
parent
5eb1cb2618
commit
e786036a4b
5 changed files with 41 additions and 8 deletions
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}}
|
||||||
|
|
@ -14,17 +14,20 @@ FROM ghcr.io/void-linux/void-glibc-full:latest
|
||||||
# Setup void packages
|
# Setup void packages
|
||||||
RUN --mount=type=cache,target=/var/cache/xbps/ \
|
RUN --mount=type=cache,target=/var/cache/xbps/ \
|
||||||
xbps-install -Syu \
|
xbps-install -Syu \
|
||||||
|
&& xbps-install -Sy \
|
||||||
bash \
|
bash \
|
||||||
bat \
|
bat \
|
||||||
cocogitto \
|
cocogitto \
|
||||||
curl \
|
curl \
|
||||||
|
eza \
|
||||||
fd \
|
fd \
|
||||||
fzf \
|
fzf \
|
||||||
gcc \
|
gcc \
|
||||||
git \
|
git \
|
||||||
|
just \
|
||||||
lazygit \
|
lazygit \
|
||||||
neovim \
|
neovim \
|
||||||
nushell \
|
nodejs \
|
||||||
ripgrep \
|
ripgrep \
|
||||||
sd \
|
sd \
|
||||||
starship \
|
starship \
|
||||||
|
|
@ -41,7 +44,7 @@ RUN --mount=type=cache,target=/var/cache/xbps/ \
|
||||||
# Import cargo packages
|
# Import cargo packages
|
||||||
COPY --from=rust-builder /usr/local/cargo/bin/* /usr/local/bin/
|
COPY --from=rust-builder /usr/local/cargo/bin/* /usr/local/bin/
|
||||||
|
|
||||||
COPY ./scripts/fetch_dots /usr/local/bin/fetch_dots
|
COPY ./scripts/* /usr/local/bin/
|
||||||
|
|
||||||
# Set environment variables
|
# Set environment variables
|
||||||
ENV EDITOR=nvim \
|
ENV EDITOR=nvim \
|
||||||
|
|
@ -49,13 +52,13 @@ 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
|
||||||
|
|
||||||
# Basic setup
|
# Basic setup
|
||||||
RUN \
|
RUN \
|
||||||
# chsh -s /usr/bin/nu ## TODO: first create a configuration for nu
|
# chsh -s /usr/bin/nu \
|
||||||
chsh -s /usr/bin/zsh \
|
chsh -s /usr/bin/zsh \
|
||||||
&& chmod +x /usr/local/bin/fetch_dots
|
&& chmod +x /usr/local/bin/*
|
||||||
|
|
||||||
# Build commands:
|
# Build commands:
|
||||||
# Docker: docker build -t devbox .
|
# Docker: docker build -t devbox .
|
||||||
|
|
|
||||||
|
|
@ -13,5 +13,4 @@ volume="${HOME}/.ssh:${HOME}/chroots/devbox/.ssh"
|
||||||
additional_packages=""
|
additional_packages=""
|
||||||
additional_flags="--hostname devbox"
|
additional_flags="--hostname devbox"
|
||||||
|
|
||||||
init_hooks=sudo -u aleidk sh -c "/usr/local/bin/fetch_dots"
|
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
|
||||||
init_hooks=rm /usr/local/bin/fetch_dots
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ cd "$base_dir" || exit
|
||||||
if [ -d dots ]; then
|
if [ -d dots ]; then
|
||||||
echo "Dots already exists, updating..."
|
echo "Dots already exists, updating..."
|
||||||
cd dots || exit
|
cd dots || exit
|
||||||
git pull
|
git pull --rebase --autostash
|
||||||
|
|
||||||
else
|
else
|
||||||
git clone ssh://git@git.alecodes.page:24062/alecodes/dots.git
|
git clone ssh://git@git.alecodes.page:24062/alecodes/dots.git
|
||||||
|
|
|
||||||
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