nixos-config/modules/nixvim/plugins/firenvim.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

39 lines
850 B
Nix

{ config, lib, pkgs, helpers, ... }:
let
cfg = config.plugins.firenvim;
in
{
options.plugins.firenvim = {
enable = lib.mkEnableOption "Firenvim";
package = helpers.mkPluginPackageOption "firenvim" pkgs.vimPlugins.firenvim;
settings = lib.mkOption {
type = with lib.types; attrsOf anything;
default = { };
description = ''
Extra configuration options for Firenvim.
'';
example = {
globalSettings = { alt = "all"; };
localSettings = {
"\".*\"" = {
cmdline = "nvim";
content = "text";
priority = 0;
selector = "textarea";
takeover = "always";
};
};
};
};
};
config = lib.mkIf cfg.enable {
extraPlugins = [ cfg.package ];
globals.firenvim_config = cfg.settings;
};
}