nixos-config/modules/nixvim/plugins/nvim-config-local.nix
Gabriel Arazas 1cd163a397
nixvim/plugins: update plugins package convention
NixVim maintainers and their whiplash decisions. ;p
2024-09-28 19:37:57 +08:00

38 lines
955 B
Nix

{ config, lib, pkgs, helpers, ... }:
let
cfg = config.plugins.nvim-config-local;
in
{
options.plugins.nvim-config-local = {
enable = lib.mkEnableOption "nvim-config-local";
package = lib.mkPackageOption pkgs [ "vimPlugins" "nvim-config-local" ] { };
settings = lib.mkOption {
type = lib.types.submodule {
freeformType = with lib.types; attrsOf anything;
options = {
config_files = lib.mkOption {
type = with lib.types; listOf str;
default = [ ".nvim.lua" ".nvimrc" ".exrc" ];
example = [ "config/nvim.lua" ];
description = ''
A list of patterns to load (includes Lua configurations).
'';
};
};
};
};
};
config =
lib.mkIf cfg.enable {
extraPlugins = [ cfg.package ];
extraConfigLua = ''
require("config-local").setup(${helpers.toLuaConfig cfg.settings})
'';
};
}