nixvim/plugins/firenvim: init

This commit is contained in:
Gabriel Arazas 2024-01-26 16:47:30 +08:00
parent c6bc18035a
commit 26822d655d
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,5 @@
{
imports = [
./plugins/firenvim.nix
];
}

View File

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