nixos-config/modules/nixvim/plugins/dressing-nvim.nix
Gabriel Arazas ac4b36d550
nixvim: update helper library usage
Hope nothing like this ever happen again. It's a pain to track where
errors are coming from when debugging nixpkgs modules. T_T
2024-05-26 16:03:18 +08:00

40 lines
937 B
Nix

{ config, lib, pkgs, helpers, ... }:
let
cfg = config.plugins.dressing-nvim;
in
{
options.plugins.dressing-nvim = {
enable = lib.mkEnableOption "dressing.nvim configuration";
package = helpers.mkPluginPackageOption "dressing.nvim" pkgs.vimPlugins.dressing-nvim;
settings = lib.mkOption {
type = with lib.types; attrsOf anything;
default = { };
example = {
input = {
enabled = true;
default_prompt = "Input";
trim_prompt = false;
};
select = {
enabled = true;
backend = [ "telescope" "fzf_lua" "builtin" "nui" ];
};
};
description = ''
Settings to be passed as argument to plugin's `setup` method.
'';
};
};
config = lib.mkIf cfg.enable {
extraPlugins = [ cfg.package ];
extraConfigLua = ''
require('dressing').setup(${helpers.toLuaObject cfg.settings})
'';
};
}