Skip to content

Latest commit

ย 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

angeldust-nvimWrap

push to cachix update locks cachix neovim nixpkgs

A fully reproducible Neovim distribution: plugins, LSPs, formatters, linters and treesitter grammars โ€” all declared in Nix, lazy-loaded with lze, and running on Neovim nightly.

Built on BirdeeHub/nix-wrapper-modules (migrated from nixCats โ€” see the migration table).

โœจ Highlights

  • ๐Ÿ” 100 % reproducible โ€” plugins, LSPs, formatters, linters, treesitter grammars, even the python3 / node / perl provider hosts come from the flake. No mason, no :PlugInstall, nothing is fetched at runtime.
  • ๐ŸŒ™ Neovim nightly is bundled, including experiments with the new vim._core.ui2 message UI: floating message window, animated LSP progress spinner, cmdheight = 0 with tiny-cmdline.nvim.
  • โšก Lazy loading via lze + lzextras (pinned from source for freshness), with a custom auto_enable handler that silently disables lua specs whose plugin nix didn't install โ€” so nix stays the single source of truth.
  • ๐Ÿงฉ plugins-<name> inputs โ€” any flake input prefixed with plugins- is built straight from its repo and exposed as config.nvim-lib.neovimPlugins.<name> (that's how flash.nvim, bafa.nvim, tiny-inline-diagnostic.nvim, โ€ฆ stay fresh).
  • ๐Ÿ—‚๏ธ Per-language specs โ€” every language owns its plugins, its CLI tools and its info values (mainInfo); config.specs.<lang>.enable = false removes all three from the wrapper โ€” the plugins, the PATH entries and the nixInfo values.
  • โœ๏ธ blink.cmp completion โ€” LuaSnip snippets, colorful-menu rendering, cmdline completion.
  • ๐Ÿฆ€ Deep Rust setup โ€” rust-analyzer (nightly), bacon-ls diagnostics as you type, RustOwl lifetime/ownership hints, crates.nvim in Cargo.toml.
  • โ„๏ธ Nix-native editing โ€” nixd + nil, alejandra / statix / deadnix, and nixd autocompleting the edited flake's NixOS / Home-Manager options (auto-detected, no hardcoded hostnames).
  • ๐ŸŽฎ The statusline awards XP for editing (triforce.nvim). Yes, really.

๐Ÿ“ฆ Installation

Requirements: Nix with flakes, x86_64-linux, a truecolor terminal. Everything else โ€” including Neovim itself โ€” is in the flake.

# try it without installing
nix run github:meflove/angeldust-nvimWrap

# install into your profile
nix profile install github:meflove/angeldust-nvimWrap

# build locally
nix build github:meflove/angeldust-nvimWrap

The first build compiles a lot (all treesitter grammars, a Rust toolchain, rust-analyzer nightly, โ€ฆ). Point nix at the binary cache to skip most of it โ€” the public key is listed on https://meflove.cachix.org:

substituters = [ "https://meflove.cachix.org" ];

NixOS / Home Manager

inputs.angeldust-nvimWrap.url = "github:meflove/angeldust-nvimWrap";

As an overlay โ€” self-contained, replaces pkgs.neovim with the wrapped editor:

nixpkgs.overlays = [ inputs.angeldust-nvimWrap.overlays.default ];
environment.systemPackages = [ pkgs.neovim ];

As a module โ€” importable and overridable from the host config:

imports = [ inputs.angeldust-nvimWrap.nixosModules.neovim ]; # or .homeModules.neovim

wrappers.neovim = {
  enable = true;
  # override anything from nix/module.nix:
  settings.colorscheme = "catppuccin-mocha";
};

home.sessionVariables.EDITOR = lib.getExe config.wrappers.neovim.wrapper;

โš ๏ธ The packages and overlays outputs are self-contained. The nixosModules / homeModules path evaluates nix/module.nix against your nixpkgs, which then needs the tooling overlays from flake.nix (fenix, bacon-ls, nu-lint, emmylua-ls, statix, rustowl) applied. See the nix-wrapper-modules getting-started guide for details.

๐Ÿ—‚๏ธ Project structure

.
โ”œโ”€โ”€ flake.nix              # inputs, tooling overlays, flake outputs
โ”œโ”€โ”€ init.lua               # bootstrap: leader keys, vim.loader, require("config")
โ”œโ”€โ”€ nix/
โ”‚   โ”œโ”€โ”€ module.nix         # composition root: imports, settings, package, hosts
โ”‚   โ”œโ”€โ”€ nvim-lib.nix       # nvim-lib helpers + spec fields (runtimePkgs, mainInfo)
โ”‚   โ”œโ”€โ”€ general.nix        # lze engine, colorscheme and the bulk of the editor
โ”‚   โ”œโ”€โ”€ langs.nix          # per-language specs, each with its own mainInfo
โ”‚   โ”œโ”€โ”€ nixd.nix           # runtime-evaluated nixd expr: the edited flake's options
โ”‚   โ””โ”€โ”€ treefmt.nix        # `nix fmt` โ€” alejandra, statix, deadnix, luafmt, prettier
โ”œโ”€โ”€ lua/config/
โ”‚   โ”œโ”€โ”€ init.lua           # nixInfo bridge + lze handler registration
โ”‚   โ”œโ”€โ”€ options.lua        # vim.opt / vim.o
โ”‚   โ”œโ”€โ”€ keymaps.lua        # global keymaps
โ”‚   โ”œโ”€โ”€ autocmds.lua       # cursor restore, auto-mkdir, LSP cleanup, โ€ฆ
โ”‚   โ”œโ”€โ”€ colorscheme.lua    # theme setup (rose-pine / catppuccin / tokyonight)
โ”‚   โ”œโ”€โ”€ ui2.lua            # vim._core.ui2 message routing (nightly)
โ”‚   โ”œโ”€โ”€ format.lua         # conform.nvim
โ”‚   โ”œโ”€โ”€ nvim-lint.lua      # nvim-lint
โ”‚   โ”œโ”€โ”€ lsp/               # core + on_attach + per-language specs
โ”‚   โ”‚   โ””โ”€โ”€ languages/     # bash, cpp, json, lua, md, nix, nulang, python, rust, ts, typst, yaml
โ”‚   โ”œโ”€โ”€ plugins/           # lze specs by concern: ui, editor, git, completion, โ€ฆ
โ”‚   โ”œโ”€โ”€ snippets/          # LuaSnip snippets (lua, nix, python)
โ”‚   โ””โ”€โ”€ utils/             # lze handlers: auto_enable, which-key, lsp ft fallback
โ”œโ”€โ”€ after/queries/         # custom treesitter query injections
โ”œโ”€โ”€ devenv.nix             # dev shell + git hooks (prek)
โ””โ”€โ”€ .github/workflows/     # cachix push, lock updates, codeberg/tangled mirror

How the two halves talk to each other:

  1. The nix/ modules decide what exists โ€” each spec carries its plugins (data), its CLI tools (runtimePkgs) and its mainInfo values; nvim-lib.nix collects the latter two into the wrapper's PATH and the info plugin.
  2. init.lua exposes them as the nixInfo global (the replacement for the old nixCats global) and registers lze handlers.
  3. The auto_enable handler compares each lua spec against the nix-installed plugin list and disables the ones nix didn't provide.

๐Ÿงฉ Customization

Colorscheme

# nix/module.nix
settings.colorscheme = "rose-pine-moon";

Available: rose-pine, rose-pine-moon, catppuccin-macchiato, catppuccin-mocha, tokyonight-storm.

Enable / disable a language

# nix/langs.nix โ€” the lua side follows automatically via auto_enable
config.specs.rust.enable = false;
# โ†‘ drops the rust plugins AND rust-analyzer / bacon / fenix from PATH

Add a plugin straight from its repo

# flake.nix โ€” the plugins- prefix is all it takes
plugins-myplugin.url = "github:author/myplugin.nvim";
plugins-myplugin.flake = false;

# nix/general.nix
general.data = [ config.nvim-lib.neovimPlugins.myplugin ];

Coming from nixCats

Migration mapping (click to expand)
nixCats here
lspsAndRuntimeDeps.<cat> config.specs.<cat>.runtimePkgs
startupPlugins.<cat> config.specs.<cat>.data (lazy = false)
optionalPlugins.<cat> config.specs.<cat>.data (lazy = true)
categories.<cat> = true config.specs.<cat>.enable (defaults to true)
nixCats.extra.<x> config.specs.<cat>.mainInfo.<x> โ†’ config.info
packageDefinitions / nixCats(...) the nixInfo global + wlib.wrapperModules.neovim
neovim-unwrapped override config.package

๐ŸŒ Language support

Language LSP Formatting Linting Extra plugins
Lua emmylua_ls luafmt (emmylua_formatter) โ€” lazydev.nvim
Nix nixd, nil alejandra statix โ€”
Python ty, ruff ruff (format + imports) โ€” โ€”
Rust rust-analyzer (nightly), bacon-ls, RustOwl rustfmt (LSP fallback) clippy (via bacon) rustaceanvim, crates.nvim, rustowl-nvim
TOML taplo โ€” โ€” crates.nvim
TypeScript/JS typescript-language-server prettierd eslint_d typescript-tools.nvim
JSON vscode-json-languageserver fixjson, json_repair jsonlint SchemaStore.nvim
YAML yaml-language-server yamlfmt, yamlfix yamllint โ€”
Shell bash-language-server shfmt shellcheck โ€”
C / C++ clangd clang-format clangtidy clangd_extensions.nvim
Markdown marksman prettierd โ€” markview.nvim, markdown-preview.nvim
Typst tinymist typstyle โ€” typst-preview.nvim
Nushell nu-lint โ€” โ€” โ€”

Also on the wrapper's PATH for everything else: ripgrep, fd, universal-ctags, tree-sitter, sqlite, unzip, ghostscript, tectonic, mermaid-cli.

โŒจ๏ธ Keybindings

<leader> is <Space>. Press <leader>? for buffer-local maps โ€” and see the which-key groups: c code, d diff, g git, m markdown, r rename, s search, t trouble, w workspace.

General

Key Action
<C-s> save (any mode)
<leader><leader> Neural Open โ€” fast file switcher
<leader>e / <leader>E toggle / focus the Snacks explorer
<leader>/ live grep
<leader>ss LSP symbols
<leader>su undo history
<leader>sr search & replace (grug-far.nvim)
<leader>. scratch buffer
gb buffer switcher (bafa.nvim)
s / S flash jump / treesitter select
<C-space> treesitter incremental selection
am im ac ic as textobjects: function / class / scope
<leader>y Y p P clipboard yank / paste helpers

LSP

Key Action
gd / gD definition / declaration
K hover (hover.nvim previews)
<C-k> signature help
<leader>rn rename
<leader>ca code action
<leader>D type definition
<leader>wa wr wl workspace folders: add / remove / list
<leader>txx / <leader>txX Trouble: project / buffer diagnostics

Git

Key Action
]c / [c next / previous hunk
<leader>gs / <leader>gr stage / reset hunk
<leader>gS / <leader>gR stage / reset buffer
<leader>gu undo stage hunk
<leader>gp preview hunk
<leader>gb blame line
<leader>gd / <leader>gD diff against index / last commit
<leader>gtb / <leader>gtd toggle line blame / deleted lines
ih hunk textobject
<leader>dm dl da deltaview menu / view / delta

Rust & Markdown

Key Action
<leader>ca rust code actions (grouped, rustaceanvim)
<leader>cro cre crd RustOwl: toggle / enable / disable
<leader>cv cf cU cA โ€ฆ crates.nvim in Cargo.toml
<leader>mp ms mt markdown preview: start / stop / toggle

๐Ÿ› ๏ธ Development

nix develop          # or: direnv allow โ€” devenv shell with prek git hooks
nix fmt              # treefmt: alejandra, statix, deadnix, luafmt, prettier
nix flake check      # formatting check
nix build .#neovim   # local build

The dev shell runs prek hooks on commit: alejandra, statix, luafmt, lua-ls, end-of-file / trailing-whitespace fixes, private-key detection.

๐Ÿ”„ CI

  • push-to-cachix โ€” every push to main builds the wrapper and pushes it to meflove.cachix.org.
  • update-flake-lock โ€” Mon & Thu: bumps flake.lock and devenv.lock.
  • mirror โ€” pushes main to Codeberg and Tangled.

๐Ÿ™ Acknowledgements

About

๐Ÿฑ Neovim Configuration on wrapper-modules โ€” a migration of my old nixCats config. Idiomatic Neovim setup with complete Nix package management: LSP, modern UI, AI tools, and multi-language support (Python, Lua, Rust, Nix, Bash, Markdown). ๐Ÿ“ฆ Pure Nix โ€” no mason.nvim or lazy.nvim required

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages