diff --git a/Makefile b/Makefile index a7aa088..a5bf527 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,10 @@ completions: .PHONY: db d-build db d-build: $(call msg,Building Docker Image) - @docker build -f docker/Dockerfile -t dots . + @DOCKER_BUILDKIT=1 docker build \ + --secret id=GITHUB_TOKEN \ + -f docker/Dockerfile \ + -t dots . ## dr, d-run | run docker image .PHONY: dr d-run diff --git a/docker/Dockerfile b/docker/Dockerfile index cfe6084..8ac5e9d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,23 +1,27 @@ +# syntax = docker/dockerfile:1.3 FROM debian:bookworm-20220822-slim ENV TERM='xterm-256color' \ HOME='/root' -COPY ./docker/install_packages.sh /usr/bin/install_packages +COPY ./docker/install-packages.sh /usr/bin/install-packages -RUN install_packages \ +RUN install-packages \ ca-certificates \ locales \ + gcc \ tmux \ curl \ gawk \ zsh \ - vim \ + vim \ git \ - neovim + python-is-python3 \ + python3 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 @@ -25,18 +29,27 @@ WORKDIR /root RUN sh -c "$(curl -fsLS https://chezmoi.io/get)" COPY . .dotfiles -RUN ./bin/chezmoi init --apply -S ~/.dotfiles + +RUN ./bin/chezmoi init \ + --apply \ + -S ~/.dotfiles \ + --promptString 'git email=daylinmorgan@gmail.com,git name=Daylin Morgan' \ + --promptBool 'use gui configs=false' 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) +RUN --mount=type=secret,id=GITHUB_TOKEN \ + GITHUB_TOKEN=$(cat /run/secrets/GITHUB_TOKEN) \ + $HOME/.dotfiles/docker/install-tools.sh # get shell extensions RUN sheldon -q --config-file ~/.config/sheldon/plugins.toml lock +# install general tools used by neovim +RUN ~/.dotfiles/docker/install-dev-envs.sh + +# install astronvim +RUN ~/.config/astronvim/install.sh + CMD ["zsh"] diff --git a/docker/TODO.md b/docker/TODO.md deleted file mode 100644 index fa06ff6..0000000 --- a/docker/TODO.md +++ /dev/null @@ -1,6 +0,0 @@ -# TODO - -- [ ] lunarvim - - [ ] install node - - [ ] install rustup/cargo - - [ ] run packer install command diff --git a/docker/install-dev-envs.sh b/docker/install-dev-envs.sh new file mode 100755 index 0000000..715cbfc --- /dev/null +++ b/docker/install-dev-envs.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +export PATH="$HOME/bin:$PATH" + +is-executable() { + [ -x "$(command -v "$1")" ] +} + +install-cargo-rustup() { + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path +} + +install-npm() { + fnm install 'v18.5.0' +} + +install-cargo-rustup + +if is-executable fnm; then + install-npm +fi diff --git a/docker/install_packages.sh b/docker/install-packages.sh similarity index 100% rename from docker/install_packages.sh rename to docker/install-packages.sh diff --git a/docker/install-tools.sh b/docker/install-tools.sh new file mode 100755 index 0000000..bfc46af --- /dev/null +++ b/docker/install-tools.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# eget() { +# "$HOME/bin/eget" "$@" +# } +export EGET_BIN=$HOME/bin + +curl https://zyedidia.github.io/eget.sh | sh && mv ./eget ./bin/eget + +tools $(cat "$HOME/.dotfiles/docker/tools.txt") + +# eget rossmacarthur/sheldon +eget tree-sitter/tree-sitter + +# installing nvim +eget neovim/neovim --to ./nvim.appimage +./nvim.appimage --appimage-extract +./squashfs-root/AppRun --version + +mv squashfs-root / +ln -s /squashfs-root/AppRun /usr/bin/nvim +rm nvim.appimage diff --git a/docker/tools.txt b/docker/tools.txt index 6d3740d..cdf91bd 100644 --- a/docker/tools.txt +++ b/docker/tools.txt @@ -1,4 +1,8 @@ +atuin +fnm +fzf +lazygit +lsd +ripgrep starship sheldon -ripgrep -lsd