neovim: use builtin home-manager module to configure coc
Alan Pearce alan@alanpearce.eu
Tue, 14 Mar 2023 16:15:22 +0100
3 files changed, 3 insertions(+), 32 deletions(-)
D user/modules/nvim-coc.nix
@@ -1,26 +0,0 @@-{ - config, - lib, - pkgs, - ... -}: -with lib; let - inherit (pkgs) stdenv; - cfg = config.programs.neovim.coc; -in { - options.programs.neovim.coc = { - config = mkOption { - type = types.attrs; - default = {}; - description = '' - Settings for coc.nvim - ''; - }; - }; - - config = { - xdg.configFile."nvim/coc-settings.json" = { - source = pkgs.writeText "coc-settings.json" (builtins.toJSON cfg.config); - }; - }; -}
M user/settings/base.nix → user/settings/base.nix
@@ -4,10 +4,6 @@ lib, pkgs, ... }: { - imports = [ - ../modules/nvim-coc.nix - ]; - # Let Home Manager install and manage itself. programs.home-manager.enable = true; manual = { @@ -33,7 +29,8 @@ zig-vim ]; extraLuaConfig = builtins.readFile ../nvim/init.lua; coc = { - config = { + enable = true; + settings = { "json.enable" = true; "suggest.enablePreview" = true; };
M user/settings/tabnine.nix → user/settings/tabnine.nix
@@ -87,7 +87,7 @@ }; }; }; - programs.neovim.coc.config = { + programs.neovim.coc.settings = { "tabnine.binary_path" = "${pkgs.tabnine}/bin/TabNine"; }; }