edrex / notes.env

A small software environment for your plain-text notes
3 stars 1 forks source link

[Discussion] modular Nix configuration for neovim #2

Closed srid closed 1 year ago

srid commented 2 years ago

[meta: Perhaps enable Discussions?]

I found a couple of Nix setup for configuring neovim in a modular fashion, and might be of interest to this project:

The idea is that adding plugins and configuring them happen modularly, so you enable a plugin using oneline change.

edrex commented 2 years ago

I was aware of https://github.com/pta2002/nixvim via @imMaturana's config but I hadn't seen syberant/nix-neovim, will TAL. I really like the idea of Spacemacs-style "Layers" for editor configuration. If you think about it, the module system used by NixOS, home-manager etc is a generalization of this approach. It allows maximum composability by passing config layers around as data.

edrex commented 2 years ago

https://github.com/aquiferma/noter/discussions/3

srid commented 2 years ago

home-manager too does this but only for coc.nvim:

https://github.com/srid/nixos-config/commit/9a6410331063ae97ae405837559cf4c5b3990ada

It could be improved to do it for other extensions as well, as neovim extensions are in principle no different to programs in home-manager (to be enabled and configured with settings).

[btw, you can convert this issue to a discussion; there should be a button to the right]

edrex commented 2 years ago

I want to get away from home-manager, which operates on your whole homedir, in preference to a native flake-based approach to configuration. I think just extracting out the module system stuff into a lib should be fairly easy. It's annoying that there is now the potential for 3 incompatible implementations of a neovim config manager: in NixOS, in HM, and in a flake. Flakes are the future (although I don't expect they will reduce the proliferation of incompatible config frameworks.)

srid commented 2 years ago

FWIW, home-manager kind of has this https://github.com/nix-community/home-manager/pull/2637

https://github.com/srid/nixos-config/commit/88a202421c262ce60509feca14ce1505b726e258

Would be nice if this got upstreamed to nixpkgs's neovim config.

edrex commented 1 year ago

I want to explore editor-integrated workflows in this project, so allowing editor implementation to be swapped out is a non-goal, at least until some nice abstaction can be found (LSP / code actions helps a lot, but doesn't cover everything).

I'm planning to go with helix for main editor in this env, at least at first. I like that it comes with everything to be productive in a single binary, good for bundling. It's missing some features for shell workflow integration though (at a minimum https://github.com/helix-editor/helix/pull/3393 is needed, and I'll be building on that branch until it gets merged).

Emacs might also be bundled behind and orgmode feature flag.