Skip to content

Conversation

@acristoffers
Copy link

@acristoffers acristoffers commented Feb 12, 2026

Closes #493

I also use Nix to configure my NeoVim installation. The modifications in this MR make it possible to use the plugin this way, or with another form of distribution that does not provide git or has a read-only plugin folder.

This is achieved by:

  1. Instead of hard-coding the server binary path to the plugin folder, use vim.fn.stdpath("data"). This is the correct place to put it in. But anyway, don't assume it's writable, and try it and all folders in the runtime to find one that we can write to, and put it there. The data folder is most probably going to be writable, but this way we can at least have more options before failing. This is already done by NeoVim itself when you try to install a spell dictionary, for example, or a tree-sitter grammar, so it is a safe way to handle this that aligns with existing practices.
  2. Give the user the option of pointing to an existing server, because why not?

To this end I changed the configuration structure to have a server key with a binary sub-key, and moved the port option inside it, for coherence.

The init script was changed to set the configuration before building, as we now need the configuration during the build.

The build function was, of course, the most affected by the changes.

A flake.nix is provided that make it easy to use the plugin with nix. It offers the plugin and server, so the user can decide if they want to let the plugin build the server as usual or if they want to let nix manage the build and just point to it in their configuration.

The server assumes the path of the emoji configuration file. I don't understand why the file is provided like that, could it not be embedded in the binary? Maybe its path could be passed as configuration by Lua when launching it? I decided to not change it though, and just make sure the config folder is where the server expects it to be.

@acristoffers acristoffers force-pushed the feature/nix-and-configurable-server-path branch from ae32ab8 to 8756cd4 Compare February 12, 2026 15:11
port = nil, -- choose random port
server = {
binary = nil, -- path to the server binary. if nil, it will be compiled, otherwise the existing binary at this path will be used
port = nil, -- choose random port
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's best to leave any documentation to just the doc/gitlab.nvim.txt file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments removed.

The plugin should not assume its folder is writable. Instead, try to
search for a writable folder by checking the data folder and the runtime
paths. Also allows the user to give the path to the server's executable
intead of always compiling it. All of this makes the plugin friendlier
to restricted/read-only environments, like nix.
@acristoffers acristoffers force-pushed the feature/nix-and-configurable-server-path branch from 8756cd4 to 4cad31e Compare February 12, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants