Skip to content

Commit

Permalink
moving to nvim usesr
Browse files Browse the repository at this point in the history
  • Loading branch information
lukegriffith committed Aug 17, 2024
1 parent 5ecca6d commit 3ece913
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
runs-on: ubuntu-latest
container:
image: ghcr.io/lukegriffith/nvim-scripts:main
options: --user nvim_user
needs: [ build ]
steps:
- name: Test NVIM
Expand Down
22 changes: 18 additions & 4 deletions neovim.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,26 @@ FROM alpine:3.20.2

LABEL maintainer="Luke Griffith <[email protected]>"

RUN apk add --no-cache neovim git curl editorconfig gcc make musl-dev go npm python3 bash
RUN apk add --no-cache neovim git curl editorconfig gcc make musl-dev go npm python3 bash shadow

ADD setup-nvim-container.sh /root/setup-nvim-container.sh
ADD package-config.sh /root/package-config.sh
# Create a new user with a home directory
RUN useradd -m -d /home/nvim_user -s /bin/sh nvim_user
RUN chmod 777 /home/nvim_user
RUN chown -R nvim_user:nvim_user /home/nvim_user

RUN bash /root/setup-nvim-container.sh
# Set the new user as the default user
USER nvim_user

# Set the working directory to the new user's home
WORKDIR /home/nvim_user


RUN ls -la /home

ADD setup-nvim-container.sh /home/nvim_user/setup-nvim-container.sh
ADD package-config.sh /home/nvim_user/package-config.sh

RUN bash /home/nvim_user/setup-nvim-container.sh

WORKDIR /src

Expand Down
4 changes: 2 additions & 2 deletions package-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ echo $formatted_tools

nvim \
--headless \
-c "MasonInstall $formatted_tools" \
-c "qa"
# -c "MasonInstall $formatted_tools" \

tar -czvf nvim-offline-deps.tar.gz /root/.config/nvim /root/.local/{share,state}/nvim
tar -czvf nvim-offline-deps.tar.gz /nvim_user/.config/nvim /nvim_user/.local/{share,state}/nvim



8 changes: 4 additions & 4 deletions setup-nvim-container.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

mkdir -p /root/bare_config /root/.config/nvim
git clone --bare https://github.com/lukegriffith/kickstart.nvim /root/bare_config
git --git-dir=/root/bare_config --work-tree=/root/.config/nvim pull
git --git-dir=/root/bare_config --work-tree=/root/.config/nvim checkout -f
mkdir -p /home/nvim_user/bare_config /home/nvim_user/.config/nvim
git clone --bare https://github.com/lukegriffith/kickstart.nvim /home/nvim_user/bare_config
git --git-dir=/home/nvim_user/bare_config --work-tree=/home/nvim_user/.config/nvim pull
git --git-dir=/home/nvim_user/bare_config --work-tree=/home/nvim_user/.config/nvim checkout -f

0 comments on commit 3ece913

Please sign in to comment.