modules/lsp: switch to explicit lib calls

This commit is contained in:
raf 2024-03-12 03:46:29 +03:00
commit c488f0490f
No known key found for this signature in database
GPG key ID: 02D1DD3FA08B6B29
33 changed files with 285 additions and 273 deletions

View file

@ -1,16 +1,16 @@
{
pkgs,
config,
lib,
...
}: let
inherit (lib) mkIf nvim;
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.lsp;
in {
config = mkIf (cfg.enable && cfg.lspkind.enable) {
vim.startPlugins = ["lspkind"];
vim.luaConfigRC.lspkind = nvim.dag.entryAnywhere ''
vim.luaConfigRC.lspkind = entryAnywhere ''
local lspkind = require'lspkind'
local lspkind_opts = {
mode = '${cfg.lspkind.mode}'

View file

@ -1,4 +1,4 @@
_: {
{
imports = [
./config.nix
./lspkind.nix

View file

@ -1,12 +1,6 @@
{
pkgs,
config,
lib,
...
}: let
inherit (lib) mkEnableOption mkOption types;
cfg = config.vim.lsp;
{lib, ...}: let
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) enum;
in {
options.vim.lsp = {
lspkind = {
@ -14,7 +8,7 @@ in {
mode = mkOption {
description = "Defines how annotations are shown";
type = with types; enum ["text" "text_symbol" "symbol_text" "symbol"];
type = enum ["text" "text_symbol" "symbol_text" "symbol"];
default = "symbol_text";
};
};