From f8e84b1e18d39632ead22b7c45fe4e97691bed29 Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Mon, 21 Sep 2026 12:16:50 +0200 Subject: Fix Neovim plugins never loading via sideloadInitLua home-manager's programs.neovim module always writes a non-empty ~/.config/nvim/init.lua, which permanently conflicts with Stow linking the dotfiles-owned lazy.nvim config to that same path - Stow skips the package and plugins never load. Setting sideloadInitLua = true frees that path for the dotfiles config to own exclusively. Also provisions a C compiler and tree-sitter (moved from dev-tools.nix) so natively- built plugins can compile on every platform. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01BBSd4VBfoKHjE1HR3P8kmn --- README.md | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index e32f0e8..75b60a8 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ A single Nix flake for provisioning both NixOS hosts and non-NixOS systems (any - `scripts/bootstrap-host.sh` — scaffolds a new `hosts//` from the template; exposed as `apps..bootstrap-host` - `modules/home/dotfiles.nix` — opt-in personal dotfiles automation (see below) - `modules/home/bash-profile.nix` — always-on `~/.bash_profile` bootstrap (see below) +- `modules/home/editor.nix` — Neovim provisioning; deliberately never writes to `~/.config/nvim` (see below) Any directory under `hosts/` other than `hosts/template` that contains a `system` file automatically becomes a real `nixosConfigurations.` output — adding a host means dropping in a directory, not editing `flake.nix`. @@ -60,6 +61,10 @@ home.dotfiles.repoUrl = "https://example.com/your/dotfiles.git"; Behavior notes: an existing `~/dotfiles` checkout is never re-cloned or modified; every non-hidden top-level directory is treated as a stow package; one package's conflict with an existing file only skips that package (a warning is printed) rather than blocking the rest. Because `~/dotfiles/git/.gitconfig` and `~/dotfiles/bash/.bashrc` are expected to be the sole sources of git and bash configuration once stowed, this repo's own `programs.git`/`programs.bash` home-manager management has been removed — `git` itself is still installed via `modules/home/cli-tools.nix`, and `bash` ships with both macOS and NixOS regardless of whether `repoUrl` is set. +## Editor (Neovim) + +`modules/home/editor.nix` installs Neovim as the default editor (`$EDITOR`/`$VISUAL`, plus a `vim` alias), and provisions a C compiler (`pkgs.stdenv.cc`) and the `tree-sitter` CLI so natively-built plugins can compile. It deliberately sets `programs.neovim.sideloadInitLua = true`, which stops home-manager from writing anything to `~/.config/nvim/init.lua` — that path is owned exclusively by the personal dotfiles repo's `neovim` Stow package (lazy.nvim + plugins). Without `sideloadInitLua`, home-manager's own generated `init.lua` permanently conflicts with that Stow package and it gets silently skipped (per the dotfiles automation's skip-on-conflict behavior above), so plugins never load. **Don't add `programs.neovim.extraConfig`/`plugins`/anything else that writes into `~/.config/nvim` here** — it would reintroduce the same conflict. + ## Login shell bootstrap NixOS and most other Linux distros don't ship a `~/.bash_profile` that sources `~/.bashrc`, so login shells never pick up your bash config. `modules/home/bash-profile.nix` creates one for you — but only if `~/.bash_profile` doesn't already exist. If it's already there (any file or symlink), it's left completely untouched; home-manager never edits or removes it. This is always on, on every platform (Linux and macOS), and isn't gated by `home.dotfiles.repoUrl` — it works whether or not you use the personal dotfiles automation above. -- cgit v1.3