From 80fb26baf45a434647ce7cccf6717c6ec76efefc Mon Sep 17 00:00:00 2001 From: pro100ton Date: Sun, 3 Nov 2024 22:37:18 +0300 Subject: [PATCH] Redo Dockerfile to build nvim from source --- Dockerfile | 31 +++++++++++++++++++++---------- Dockerfile_old | 26 ++++++++++++++++++++++++++ lua/t0xa/plugins/lsp/mason.lua | 4 ++++ lua/t0xa/plugins/rust-tools.lua | 3 +++ 4 files changed, 54 insertions(+), 10 deletions(-) create mode 100644 Dockerfile_old create mode 100644 lua/t0xa/plugins/rust-tools.lua diff --git a/Dockerfile b/Dockerfile index a28923a..5d86dda 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,13 @@ FROM ubuntu:latest -LABEL maintainer="pro100ton@gmail.com" - -RUN apt-get update && apt-get install -y \ +# Install build tools and nvim deps +RUN apt-get update && apt-get install -y --no-install-recommends \ + cmake \ + gettext \ + unzip \ + git \ build-essential \ curl \ - neovim \ - git \ nodejs \ npm \ fzf \ @@ -14,13 +15,23 @@ RUN apt-get update && apt-get install -y \ python3 \ python3-pip \ python3-venv \ - unzip \ ripgrep -RUN useradd -m nvim_playground +# Clone neovim repo +RUN git clone --depth 1 --branch v0.10.1 https://github.com/neovim/neovim.git +# Build neovim +RUN cd neovim && CMAKE_BUILD_TYPE=Release && make install + +# Install rust +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -y | sh + +# Create user +RUN useradd -m nvim_playground USER nvim_playground -RUN mkdir /home/nvim_playground/.config -RUN mkdir /home/nvim_playground/.config/nvim +# Copy config to user folders +RUN mkdir -p /home/nvim_playground/.config/nvim WORKDIR /home/nvim_playground/.config/nvim -COPY . . +COPY --chown=nvim_playground:nvim_playground . . + +USER nvim_playground diff --git a/Dockerfile_old b/Dockerfile_old new file mode 100644 index 0000000..a28923a --- /dev/null +++ b/Dockerfile_old @@ -0,0 +1,26 @@ +FROM ubuntu:latest + +LABEL maintainer="pro100ton@gmail.com" + +RUN apt-get update && apt-get install -y \ + build-essential \ + curl \ + neovim \ + git \ + nodejs \ + npm \ + fzf \ + golang-go \ + python3 \ + python3-pip \ + python3-venv \ + unzip \ + ripgrep +RUN useradd -m nvim_playground + +USER nvim_playground + +RUN mkdir /home/nvim_playground/.config +RUN mkdir /home/nvim_playground/.config/nvim +WORKDIR /home/nvim_playground/.config/nvim +COPY . . diff --git a/lua/t0xa/plugins/lsp/mason.lua b/lua/t0xa/plugins/lsp/mason.lua index ba337dc..4545c44 100644 --- a/lua/t0xa/plugins/lsp/mason.lua +++ b/lua/t0xa/plugins/lsp/mason.lua @@ -35,10 +35,14 @@ return { mason_tool_installer.setup({ ensure_installed = { + "rust-analyzer", + "golines", + "goimports-reviser", "prettier", -- prettier formatter "stylua", -- lua formatter "isort", -- python formatter "black", -- python formatter + "gofumpt", "pylint", "flake8", -- Astra settings for 3.7 Python diff --git a/lua/t0xa/plugins/rust-tools.lua b/lua/t0xa/plugins/rust-tools.lua new file mode 100644 index 0000000..2a55153 --- /dev/null +++ b/lua/t0xa/plugins/rust-tools.lua @@ -0,0 +1,3 @@ +return { + "simrat39/rust-tools.nvim", +}