Skip to content

Commit 3854b51

Browse files
committed
Move nvim to distrobox away from custom container
1 parent edb2601 commit 3854b51

23 files changed

Lines changed: 688 additions & 548 deletions

File tree

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Build and publish nvim-dev container image
2+
# Triggered on changes to dot_files/nvim/ or manual dispatch
3+
# Image published to: ghcr.io/binarypie/nvim-dev:latest
4+
5+
name: Build nvim-dev Image
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
paths:
12+
- 'dot_files/nvim/Containerfile'
13+
- '.github/workflows/build-nvim-dev.yml'
14+
pull_request:
15+
paths:
16+
- 'dot_files/nvim/Containerfile'
17+
- '.github/workflows/build-nvim-dev.yml'
18+
workflow_dispatch:
19+
schedule:
20+
# Rebuild weekly to get updated packages
21+
- cron: '0 6 * * 0'
22+
23+
env:
24+
IMAGE_NAME: nvim-dev
25+
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
26+
27+
jobs:
28+
build:
29+
runs-on: ubuntu-latest
30+
permissions:
31+
contents: read
32+
packages: write
33+
34+
steps:
35+
- name: Checkout repository
36+
uses: actions/checkout@v4
37+
38+
- name: Set up Docker Buildx
39+
uses: docker/setup-buildx-action@v3
40+
41+
- name: Log in to GitHub Container Registry
42+
if: github.event_name != 'pull_request'
43+
uses: docker/login-action@v3
44+
with:
45+
registry: ghcr.io
46+
username: ${{ github.actor }}
47+
password: ${{ secrets.GITHUB_TOKEN }}
48+
49+
- name: Extract metadata
50+
id: meta
51+
uses: docker/metadata-action@v5
52+
with:
53+
images: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}
54+
tags: |
55+
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
56+
type=sha,prefix=
57+
type=ref,event=pr
58+
59+
- name: Build and push
60+
uses: docker/build-push-action@v5
61+
with:
62+
context: dot_files/nvim
63+
file: dot_files/nvim/Containerfile
64+
push: ${{ github.event_name != 'pull_request' }}
65+
tags: ${{ steps.meta.outputs.tags }}
66+
labels: ${{ steps.meta.outputs.labels }}
67+
cache-from: type=gha
68+
cache-to: type=gha,mode=max
69+
70+
- name: Generate build summary
71+
if: github.event_name != 'pull_request'
72+
run: |
73+
echo "## nvim-dev Image Built" >> $GITHUB_STEP_SUMMARY
74+
echo "" >> $GITHUB_STEP_SUMMARY
75+
echo "**Image:** \`${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest\`" >> $GITHUB_STEP_SUMMARY
76+
echo "" >> $GITHUB_STEP_SUMMARY
77+
echo "### Usage" >> $GITHUB_STEP_SUMMARY
78+
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
79+
echo "distrobox create --name nvim-dev --image ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest" >> $GITHUB_STEP_SUMMARY
80+
echo "distrobox enter nvim-dev" >> $GITHUB_STEP_SUMMARY
81+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ hypercube/
8282
| `00-hypercube-branding.sh` | OS release info, Plymouth theme, GDM dconf |
8383
| `01-hypercube-packages.sh` | Package installation via DNF/COPR |
8484
| `02-hypercube-theming.sh` | Tokyo Night GTK/icon theme installation |
85-
| `03-hypercube-configs.sh` | Config file deployment (fish, nvimd, etc.) |
85+
| `03-hypercube-configs.sh` | Config file deployment (fish, gtk, etc.) |
8686
| `99-tests.sh` | Validation tests for required packages/files |
8787

8888
### Configuration Deployment

build_files/hypercube/03-hypercube-configs.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ echo "Installing Hypercube configurations..."
88

99
CONFIG_DIR="/usr/share/hypercube/config"
1010

11-
### Install nvimd (containerized neovim wrapper)
12-
install -Dm755 "${CONFIG_DIR}/nvim/bin/nvimd" /usr/bin/nvimd
13-
1411
### Fish shell configs
1512
# Fish doesn't use XDG_CONFIG_DIRS, so we install to /etc/fish
1613
install -Dm644 "${CONFIG_DIR}/fish/config.fish" /etc/fish/config.fish
@@ -58,6 +55,15 @@ source = /usr/share/hypercube/config/hypr/hyprland.conf
5855
5956
EOF
6057

58+
### Neovim - skel that loads hypercube plugin from system config
59+
# System config at /usr/share/hypercube/config/nvim/ provides the hypercube plugin
60+
# Users get a minimal config that imports it and can add their own plugins
61+
mkdir -p /etc/skel/.config/nvim/lua/config
62+
mkdir -p /etc/skel/.config/nvim/lua/plugins
63+
cp "${CONFIG_DIR}/nvim/skel/init.lua" /etc/skel/.config/nvim/
64+
cp "${CONFIG_DIR}/nvim/skel/lua/config/lazy.lua" /etc/skel/.config/nvim/lua/config/
65+
cp "${CONFIG_DIR}/nvim/skel/lua/plugins/example.lua" /etc/skel/.config/nvim/lua/plugins/
66+
6167
### GTK theme settings - install to /etc/xdg/ for system-wide defaults
6268
# Users can override by creating ~/.config/gtk-3.0/settings.ini
6369
install -Dm644 "${CONFIG_DIR}/gtk-3.0/settings.ini" /etc/xdg/gtk-3.0/settings.ini

build_files/hypercube/99-tests.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ REQUIRED_FILES=(
4545
# greetd
4646
"/etc/greetd/config.toml"
4747
# Config files
48-
"/usr/bin/nvimd"
4948
"/etc/fish/config.fish"
5049
"/usr/share/hypercube/config/starship/starship.toml"
5150
# Theming

0 commit comments

Comments
 (0)