Is there much point in managing software like Neovim and Hyprland with NixOS?

I think its overrated when a lot of software like Neovim & Hyprland already provide declarative or text-based / scripting configuration. There isn’t much use in managing them with NixOS or Home Manager other than for:

  1. Complete reproducibility, which I think very few users actually need from Hyprland, Neovim, etc. The same configurations from these should already produce very similar if not the exact same results from device to device. Don’t get me wrong, the reproducibility and declarative config of NixOS is invaluable, its a godsend when other major operating systems require a bunch of mouse clicking and manual post-installation configuration.
  2. Automatically writing to home directories like .config, though I don’t think its worth the tradeoff of waiting for commands like nixos-rebuild to finish. Neovim at worst needs a quick restart to see configuration (the vast majority of Neovim configurations literally take fractions of a second, & with comprehensive lazy loading), and Hyprland configuration reloads immediately.

Non-simple NixOS configurations need multiple files, and these days many if not most users have both flake.nix and a configuration.nix. Since I already need all my nix files in a folder, I use Chezmoi for managing dotfiles: flake.nix is at the top of the directory, with my nix files a folder called nix (and listed in .chezmoiignore). dot_config contains the folders that get written to ~/.config, including hypr and nvim.

Since this topic is an opinion and not a question, I’ll say many people clearly disagree (see the stars on GitHub - NotAShelf/nvf: Modular, extensible and distro-agnostic Neovim configuration framework for Nix/NixOS · GitHub for example).

It’s also useful to have the binary wrapped with the config as part of a devshell, so you have the common nvim config across systems, and with direnv you don’t even need to run any commands for the rebuild to occur.

But it depends entirely on what you find useful.

3 Likes

Personally I find it immensely useful, though I use sway and emacs. Not having to manually replicate stuff across systems, especially for the relatively complex multi-process/application setups that your typical text editor/WM is, is really, really nice.

Of course that can be done without nix, but before NixOS/home-manager I used to regularly have issues with software version mismatches, or even just small config misalignment or customization causing cascading problems, which using nix to fully declaratively manage these applications just completely fixes. It absolutely is worth the tradeoff of 10 second rebuilds, I hardly even notice those after the initial week of setup (and when I do some ad-hoc modification, any application worth its salt has ways to try stuff out without fully rebuilding - I can always commit the final product to nix config later).

Of course, if you don’t care about spending an hour to fix some bug on your laptop every few months, or if your configuration truly is simple enough that that doesn’t happen, maybe nix isn’t actually useful, and the overhead of spending 20 minutes once learning how to reload your sway config without a rebuild is too much.

I have to admit that I find it hard to believe, though, even super basic stuff like session init management is an absolute pain to get right, and hardly possible with just copying a .config directory because of how much variance there is between distros. Or what about mime associations? And that’s before you even touch editor plugins, their versioning, or their integration with host software, language servers and tree-sitter grammars. Add differences between work/personal computer configuration, which are often hard to express cleanly without something like the NixOS module system…

No, seriously, how do y’all not have these issues?

6 Likes