Set up a Go neovim development environment in one command using Nix

Any feedback is welcome :slight_smile:

1 Like

So people tend to have their own personal vim configurations that include more than language support so I am not sure how useful this is on its own but it might be a solid reference as just a minimal golang neovim setup. In fact, now I might be going to add something similar as an example to nix2vim :smiley:

Also a little tip: consider using builtins.readFile instead large strings in nix. This way you get syntax highlighting

2 Likes

Here’s-how-I-do-it:

For packages like neovim or tmux… since I’d want to run these in whatever directory I’m in, I’d want these installed globally. I use pkgs.buildEnv as described in the 2.6.2. “Declarative Package Management” of the nixpkgs manual, and just install that to the user profile. (I started Nix without using NixOS, without using HM; and still like this approach well enough).

For language+lsp+lint, TBH I like the idea of having this specific to the project. In the same direction as using the devShell output of the flake, I’d use direnv with a .envrc like use flake github:.... Then, any terminal-based editor run from that directory, or any GUI editor with a direnv plugin, can use the language+lsp.

Hosted by Flying Circus.