From 29228057f647bc7ab144fc2c838eabf6852e48b8 Mon Sep 17 00:00:00 2001 From: bumpsoo Date: Mon, 10 Feb 2025 14:12:52 +0000 Subject: [PATCH] fix - changed the terminal conf to docker --- .config/nvim/lua/bumpsoo/plugins/lazygit.lua | 16 ------ .config/nvim/lua/bumpsoo/set.lua | 2 + .shrc | 11 ----- .ssh/config | 4 -- .tmux.conf | 3 +- Dockerfile | 51 ++++++++++++++++++++ Makefile | 26 ++++++++++ README.md | 32 +++++++++--- install.sh | 19 -------- .gitconfig => personal.gitconfig | 10 ++-- personal/.gitconfig | 3 -- 11 files changed, 111 insertions(+), 66 deletions(-) delete mode 100644 .config/nvim/lua/bumpsoo/plugins/lazygit.lua delete mode 100644 .shrc delete mode 100644 .ssh/config create mode 100644 Dockerfile create mode 100644 Makefile delete mode 100644 install.sh rename .gitconfig => personal.gitconfig (68%) delete mode 100644 personal/.gitconfig diff --git a/.config/nvim/lua/bumpsoo/plugins/lazygit.lua b/.config/nvim/lua/bumpsoo/plugins/lazygit.lua deleted file mode 100644 index b753609..0000000 --- a/.config/nvim/lua/bumpsoo/plugins/lazygit.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - "kdheepak/lazygit.nvim", - cmd = { - "LazyGit", - "LazyGitConfig", - "LazyGitCurrentFile", - "LazyGitFilter", - "LazyGitFilterCurrentFile", - }, - dependencies = { - "nvim-lua/plenary.nvim", - }, - keys = { - { "lg", "LazyGit", desc = "LazyGit" } - } -} diff --git a/.config/nvim/lua/bumpsoo/set.lua b/.config/nvim/lua/bumpsoo/set.lua index 52bb43d..60d4499 100644 --- a/.config/nvim/lua/bumpsoo/set.lua +++ b/.config/nvim/lua/bumpsoo/set.lua @@ -19,3 +19,5 @@ vim.opt.expandtab = true vim.opt.clipboard = "unnamedplus" vim.opt.swapfile = false + +vim.opt.termguicolors = true diff --git a/.shrc b/.shrc deleted file mode 100644 index e7cfb42..0000000 --- a/.shrc +++ /dev/null @@ -1,11 +0,0 @@ -EDITOR=/usr/bin/nvim -alias vi=nvim -alias vim=nvim - -alias la='ls -a' -alias ll='ls -al' - -export PATH="$PATH:/opt/nvim-linux64/bin" -export PATH=$PATH:/usr/local/go/bin -export PATH=$PATH:~/go/bin - diff --git a/.ssh/config b/.ssh/config deleted file mode 100644 index 62e2d24..0000000 --- a/.ssh/config +++ /dev/null @@ -1,4 +0,0 @@ -Host github.com-work - HostName github.com - User git - IdentityFile ~/.ssh/id_ed25519-work diff --git a/.tmux.conf b/.tmux.conf index e8cef88..2b9e582 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -3,4 +3,5 @@ setw -g mode-keys vi bind-key -T copy-mode-vi v send-keys -X begin-selection bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel bind-key -T copy-mode-vi 'r' send -X rectangle-toggle -set -s copy-command 'xsel -ib' +set -s copy-command 'wl-copy' + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c4484b4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,51 @@ +FROM debian:trixie + +RUN apt-get update && apt-get install -y \ + git \ + neovim \ + man-db \ + openssh-client \ + passwd \ + gcc \ + ripgrep \ + wl-clipboard \ + tmux \ + curl \ + python3-pip \ + python3-venv \ + nodejs + +ARG UID +ARG GID +ARG USERNAME +ARG CONFIG_PREFIX + +ENV USERNAME=${USERNAME:-bumpsoo} +ENV UID=${UID:-1000} +ENV GID=${GID:-$UID} +ENV CONFIG_PREFIX=${CONFIG_PREFIX:-personal} +ENV TERM=xterm-256color + +RUN set -eux; \ + groupadd -g "$GID" "$USERNAME"; \ + useradd -m -u "$UID" -g "$USERNAME" -s /bin/bash "$USERNAME"; \ + mkdir -p /workspace; \ + chown "$USERNAME:$USERNAME" /workspace + +WORKDIR /workspace + +ENV HOME=/home/${USERNAME} + +USER ${USERNAME} + +RUN python3 -m venv $HOME/py && $HOME/py/bin/pip install pyright +RUN echo "export PATH=\"$HOME/py/bin:$PATH\"" >> $HOME/.bashrc + +COPY --chown=${USERNAME}:${GID} ${CONFIG_PREFIX}.gitconfig /home/${USERNAME}/.gitconfig + +COPY --chown=${USERNAME}:${GID} .config/nvim /home/${USERNAME}/.config/nvim + +COPY --chown=${USERNAME}:${GID} .tmux.conf /home/${USERNAME}/.tmux.conf + +CMD ["/bin/bash"] + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2574f08 --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +RUN_OPTION=\ + -it \ + -v ${HOME}/.ssh:/home/$(shell id -un)/.ssh \ + -v ${PWD}:/workspace + +ifdef WAYLAND_DISPLAY + RUN_OPTION += \ + -e WAYLAND_DISPLAY=${WAYLAND_DISPLAY} \ + -e XDG_RUNTIME_DIR=/run/user/$(shell id -u) \ + -v /run/user/$(shell id -u)/wayland-0:/run/user/$(shell id -u)/wayland-0 +endif + +BUILD_OPTION=\ + --build-arg USERNAME=$(shell id -un) \ + --build-arg UID=$(shell id -u) + +ifdef FORCE_BUILD + BUILD_OPTION += \ + --no-cache +endif +run: build + docker run ${RUN_OPTION} dev + +build: + docker build ${BUILD_OPTION} -t dev . + diff --git a/README.md b/README.md index 65c516a..3a8050c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,24 @@ -### configurations for terminal +### build image -- neovim (.config/nvim/\*) -- git (.gitconfig ~/personal/.gitconfig) -- tmux (.tmux.conf) -- shell (.profile) -- ssh (.ssh) +``` +make build +``` + +### run image + +``` +make + +or +cd workspace +make -C terminal_configuration_path +``` + +### configurations + +- neovim +- git +- tmux ### neovim plugins @@ -14,3 +28,9 @@ - solarized - lspconfig - fugitive + +### prerequsites + +- docker +- build-essential ( debian ) ( Makefile ) + diff --git a/install.sh b/install.sh deleted file mode 100644 index 4cab8c6..0000000 --- a/install.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# nvm -curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash - -# neovim -curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz -sudo rm -rf /opt/nvim -sudo tar -C /opt -xzf nvim-linux64.tar.gz -sudo rm nvim-linux64.tar.gz - -# go -if [ -z "$GO_VERSION" ] -then - GO_VERSION="1.22.0" -fi - -curl -LO https://go.dev/dl/go$GO_VERSION.linux-amd64.tar.gz -sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go$GO_VERSION.linux-amd64.tar.gz -sudo rm go$GO_VERSION.linux-amd64.tar.gz diff --git a/.gitconfig b/personal.gitconfig similarity index 68% rename from .gitconfig rename to personal.gitconfig index 5c2a5e5..31a50a4 100644 --- a/.gitconfig +++ b/personal.gitconfig @@ -9,11 +9,9 @@ [user] useConfigOnly = true -[includeIf "gitdir:~/work/"] - path = ~/work/.gitconfig - -[includeIf "gitdir:~/personal/"] - path = ~/personal/.gitconfig - [core] editor = nvim + +[user] + name = bumpsoo + email = bumpsoo063@protonmail.ch diff --git a/personal/.gitconfig b/personal/.gitconfig deleted file mode 100644 index 4abb361..0000000 --- a/personal/.gitconfig +++ /dev/null @@ -1,3 +0,0 @@ -[user] - name = bumpsoo - email = bumpsoo063@protonmail.ch