Compare commits
3 commits
149f441bbe
...
83fdfa8af8
Author | SHA1 | Date | |
---|---|---|---|
83fdfa8af8 | |||
642029777e | |||
65593fc479 |
7 changed files with 113 additions and 14 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -158,5 +158,4 @@ cython_debug/
|
||||||
|
|
||||||
# End of https://www.toptal.com/developers/gitignore/api/python
|
# End of https://www.toptal.com/developers/gitignore/api/python
|
||||||
|
|
||||||
# pdm
|
.task.mk
|
||||||
__pypackages__
|
|
||||||
|
|
31
Makefile
31
Makefile
|
@ -1,9 +1,40 @@
|
||||||
.PHONY: lint lint.py lint.sh
|
.PHONY: lint lint.py lint.sh
|
||||||
|
|
||||||
|
## lint | lint.*
|
||||||
lint: lint.py lint.sh
|
lint: lint.py lint.sh
|
||||||
|
|
||||||
|
## lint.python | lint python files
|
||||||
lint.python:
|
lint.python:
|
||||||
black $(shell find -type f -name "*.py")
|
black $(shell find -type f -name "*.py")
|
||||||
|
|
||||||
|
## lint.sh | lint shell files
|
||||||
lint.sh:
|
lint.sh:
|
||||||
shfmt -s -w $(shell shfmt -f .)
|
shfmt -s -w $(shell shfmt -f .)
|
||||||
|
|
||||||
|
.PHONY: $(addprefix d-,b r build run)
|
||||||
|
|
||||||
|
## db, d-build | build docker image
|
||||||
|
db d-build:
|
||||||
|
docker build -f docker/Dockerfile -t dots .
|
||||||
|
|
||||||
|
## dr, d-run | run docker image
|
||||||
|
dr d-run:
|
||||||
|
docker run --rm -it dots
|
||||||
|
|
||||||
|
.PHONY: dr-keep
|
||||||
|
dr-keep:
|
||||||
|
docker run -it dots
|
||||||
|
|
||||||
|
.DEFAULT_GOAL := help
|
||||||
|
# ## h, help | show this help
|
||||||
|
# .PHONY: help h
|
||||||
|
# help h: Makefile
|
||||||
|
# @awk -v fill=$(shell sed -n 's/^## \(.*\) | .*/\1/p' $< | wc -L)\
|
||||||
|
# 'match($$0,/^## (.*) \|/,name) && match($$0,/\| (.*)$$/,help)\
|
||||||
|
# {printf "\033[1;93m%*s\033[0m | \033[30m%s\033[0m\n",\
|
||||||
|
# fill,name[1],help[1];} match($$0,/^### (.*)/,str) \
|
||||||
|
# {printf "%*s \033[30m%s\033[0m\n",fill," ",str[1];}' $<
|
||||||
|
GOAL_COLOR=b_magenta
|
||||||
|
HELP_SEP= ->>
|
||||||
|
-include .task.mk
|
||||||
|
$(if $(filter help,$(MAKECMDGOALS)),.task.mk: ; curl -fsSL https://raw.githubusercontent.com/daylinmorgan/task.mk/v22.9.5/task.mk -o .task.mk)
|
||||||
|
|
42
docker/Dockerfile
Normal file
42
docker/Dockerfile
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
FROM debian:bookworm-20220822-slim
|
||||||
|
|
||||||
|
ENV TERM='xterm-256color' \
|
||||||
|
HOME='/root'
|
||||||
|
|
||||||
|
COPY ./docker/install_packages.sh /usr/bin/install_packages
|
||||||
|
|
||||||
|
RUN install_packages \
|
||||||
|
ca-certificates \
|
||||||
|
locales \
|
||||||
|
tmux \
|
||||||
|
curl \
|
||||||
|
gawk \
|
||||||
|
zsh \
|
||||||
|
vim \
|
||||||
|
git \
|
||||||
|
neovim
|
||||||
|
|
||||||
|
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
|
||||||
|
locale-gen
|
||||||
|
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
|
||||||
|
|
||||||
|
WORKDIR /root
|
||||||
|
|
||||||
|
RUN sh -c "$(curl -fsLS https://chezmoi.io/get)"
|
||||||
|
|
||||||
|
COPY . .dotfiles
|
||||||
|
RUN ./bin/chezmoi init --apply -S ~/.dotfiles
|
||||||
|
|
||||||
|
ENV DOTFILES_DIR="$HOME/.dotfiles" \
|
||||||
|
PATH="$PATH:$HOME/bin:$HOME/.dotfiles/bin"
|
||||||
|
|
||||||
|
# setup eget for tools script
|
||||||
|
RUN curl https://zyedidia.github.io/eget.sh | sh && mv ./eget ./bin/eget
|
||||||
|
|
||||||
|
# use eget to fetch yq and some needed tools
|
||||||
|
RUN tools $(cat .dotfiles/docker/tools.txt)
|
||||||
|
|
||||||
|
# get shell extensions
|
||||||
|
RUN sheldon -q --config-file ~/.config/sheldon/plugins.toml lock
|
||||||
|
|
||||||
|
CMD ["zsh"]
|
24
docker/install_packages.sh
Executable file
24
docker/install_packages.sh
Executable file
|
@ -0,0 +1,24 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
set -u
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
n=0
|
||||||
|
max=2
|
||||||
|
until [ $n -gt $max ]; do
|
||||||
|
set +e
|
||||||
|
(
|
||||||
|
apt-get update -qq &&
|
||||||
|
apt-get install -y --no-install-recommends "$@"
|
||||||
|
)
|
||||||
|
CODE=$?
|
||||||
|
set -e
|
||||||
|
if [ $CODE -eq 0 ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
if [ $n -eq $max ]; then
|
||||||
|
exit $CODE
|
||||||
|
fi
|
||||||
|
echo "apt failed, retrying"
|
||||||
|
n=$((n + 1))
|
||||||
|
done
|
||||||
|
rm -r /var/lib/apt/lists /var/cache/apt/archives
|
4
docker/tools.txt
Normal file
4
docker/tools.txt
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
starship
|
||||||
|
sheldon
|
||||||
|
ripgrep
|
||||||
|
lsd
|
|
@ -19,7 +19,6 @@ INSTALL_NO=${RED}✗${NORMAL}
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
BINARY_FILES=($HOME/bin/*)
|
BINARY_FILES=($HOME/bin/*)
|
||||||
|
|
||||||
|
|
||||||
export EGET_BIN=$HOME/bin
|
export EGET_BIN=$HOME/bin
|
||||||
alias eget="eget --system linux/amd64"
|
alias eget="eget --system linux/amd64"
|
||||||
|
|
||||||
|
|
|
@ -24,9 +24,9 @@ fi
|
||||||
|
|
||||||
# >>> mamba initialize >>>
|
# >>> mamba initialize >>>
|
||||||
# !! Contents within this block are managed by 'mamba init' !!
|
# !! Contents within this block are managed by 'mamba init' !!
|
||||||
export MAMBA_EXE="/home/daylin/.local/bin/micromamba";
|
export MAMBA_EXE="/home/daylin/.local/bin/micromamba"
|
||||||
export MAMBA_ROOT_PREFIX="/home/daylin/micromamba";
|
export MAMBA_ROOT_PREFIX="/home/daylin/micromamba"
|
||||||
__mamba_setup="$('/home/daylin/.local/bin/micromamba' shell hook --shell zsh --prefix '/home/daylin/micromamba' 2> /dev/null)"
|
__mamba_setup="$('/home/daylin/.local/bin/micromamba' shell hook --shell zsh --prefix '/home/daylin/micromamba' 2>/dev/null)"
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
eval "$__mamba_setup"
|
eval "$__mamba_setup"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue