neovim: Add coc support (#2154)

This adds two new options: 'programs.neovim.coc.{enable,settings}`.

These settings offer a simple interface over `xdg.configFile."nvim/coc-settings.json`,
using the standard Nix' syntax instead of a multiline string.
This commit is contained in:
t4ccer 2021-07-26 04:40:07 +02:00 committed by GitHub
parent 0423a7b40c
commit addc78bea0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 79 additions and 3 deletions

View file

@ -0,0 +1,3 @@
{
"foo": "bar"
}

View file

@ -0,0 +1,27 @@
{ config, lib, pkgs, ... }:
with lib;
{
config = {
programs.neovim = {
enable = true;
coc = {
enable = true;
settings = {
# my variable
foo = "bar";
};
};
};
nmt.script = ''
cocSettings="$TESTED/home-files/.config/nvim/coc-settings.json"
cocSettingsNormalized="$(normalizeStorePaths "$cocSettings")"
assertFileExists "$cocSettings"
assertFileContent "$cocSettingsNormalized" "${./coc-config.expected}"
'';
};
}

View file

@ -1,5 +1,6 @@
{
neovim-plugin-config = ./plugin-config.nix;
neovim-coc-config = ./coc-config.nix;
# waiting for a nixpkgs patch
# neovim-no-init = ./no-init.nix;
}