--- tags: - service - josiedot - devtools domain: devspaces.apps.hub.euw.container.mom status: active stack: - Neovim - ttyd - Podman - OpenShift Dev Spaces auth: Dev Spaces (Keycloak) --- # neoche (Dev Spaces Neovim Editor) Neovim editor integration for Eclipse Che / Red Hat OpenShift Dev Spaces. Runs Neovim in the browser via ttyd using the init container injection pattern from che-code. ## URLs - Dashboard: https://devspaces.apps.hub.euw.container.mom - Editor endpoint: port 7681 on workspace route - Launch any repo: `https://devspaces.apps.hub.euw.container.mom/#https://github.com//?che-editor=neoche/neovim/insiders` ## Stack - Neovim 0.10.4 (glibc + musl builds) - ttyd 1.7.7 (web terminal) - machine-exec 7.56.0 (Che terminal multiplexing, port 3333) - Container: FROM scratch, 6-stage multi-stage UBI9 rootfs - Registry: quay.io/pfeifferj/neoche:insiders (private, global pull secret configured) ## Architecture 1. **preStart**: `neovim-injector` init container copies binaries to shared `/neovim` volume 2. **postStart**: workspace container runs `entrypoint-volume.sh` which: - Detects platform (glibc/musl via `ldd /bin/ls`) - Starts machine-exec on port 3333 - Clones dotfiles if `DOTFILES_REPO` is set (uses `DOTFILES_TOKEN` for private repos) - Bootstraps a Neovim distribution if `NVIM_DISTRO` is set - Launches ttyd+nvim on port 7681 Ships both glibc and musl Neovim builds; runtime detection selects the right one for any base image. ## Dotfiles - `DOTFILES_REPO` env var in editor definition: `https://github.com/pfeifferj/dotfiles` - Repo contains `.config/nvim/` with lazy.nvim config (leader=`,`, nvim-tree, telescope, lualine, treesitter, etc.) - Private repo auth via `DOTFILES_TOKEN` injected from Kubernetes secret `neoche-dotfiles` in workspace namespace - Secret uses DevWorkspace Operator automount: `controller.devfile.io/mount-to-devworkspace: "true"` + `controller.devfile.io/mount-as: env` - Entrypoint clones dotfiles, copies `.config/` to `$HOME`, then treesitter/lazy.nvim install on first open - Treesitter requires `prefer_git = true` in container environments ## Distribution Bootstrapping If no dotfiles and no existing config, `NVIM_DISTRO` env var bootstraps: - `lazyvim`, `astrovim`, `nvchad`, `kickstart` ## Cluster Config - **Namespace (control plane)**: `openshift-devspaces` - **Namespace (workspaces)**: `josie-devspaces` - **CheCluster**: `devspaces` in `openshift-devspaces`, default editor `che-incubator/che-code/latest` - **Editor ConfigMap**: `neovim-editor-definition` with labels `app.kubernetes.io/part-of=che.eclipse.org` + `app.kubernetes.io/component=editor-definition` - **Pull secret**: quay.io creds merged into cluster global pull secret (`openshift-config/pull-secret`) - **Storage**: `devspaces-storage` StorageClass (no-provisioner, WaitForFirstConsumer), local PV `devspaces-josie-pv` at `/var/devspaces/josie` on `master-0`, Retain policy (must clear claimRef after workspace deletion) - **GitHub PAT**: secret `github-pat-josie` in `josie-devspaces` with `che.eclipse.org/scm-personal-access-token` labels for private repo cloning - **Dotfiles token**: secret `neoche-dotfiles` in `josie-devspaces` with DevWorkspace Operator automount labels ## Deployment - `make build` (podman, multi-stage Dockerfile) - `make push` (quay.io/pfeifferj/neoche:insiders) - `make deploy-editor` (oc create configmap + oc label) ## Known Issues - PV claimRef must be manually cleared after workspace deletion (`oc patch pv devspaces-josie-pv --type json -p '[{"op":"remove","path":"/spec/claimRef"}]'`) - nvim-treesitter curl download fails in containers; use `prefer_git = true` - Workspace SA is created dynamically per workspace; global pull secret is the reliable way to provide image pull access ## Source - Repo: `/home/josie/development/personal/neoche` - Dotfiles: `github.com/pfeifferj/dotfiles` (private) - License: EPL-2.0 ## Related - [[services]]