2024-02-06 23:54:37 +00:00
|
|
|
{ config, lib, pkgs, helpers, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.plugins.nvim-config-local;
|
|
|
|
in
|
|
|
|
{
|
2024-08-15 04:49:44 +00:00
|
|
|
options.plugins.nvim-config-local = {
|
|
|
|
enable = lib.mkEnableOption "nvim-config-local";
|
2024-02-06 23:54:37 +00:00
|
|
|
|
2024-09-28 11:37:57 +00:00
|
|
|
package = lib.mkPackageOption pkgs [ "vimPlugins" "nvim-config-local" ] { };
|
2024-02-06 23:54:37 +00:00
|
|
|
|
2024-08-15 04:49:44 +00:00
|
|
|
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).
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2024-02-06 23:54:37 +00:00
|
|
|
};
|
|
|
|
};
|
2024-08-15 04:49:44 +00:00
|
|
|
};
|
2024-02-06 23:54:37 +00:00
|
|
|
|
|
|
|
config =
|
|
|
|
lib.mkIf cfg.enable {
|
|
|
|
extraPlugins = [ cfg.package ];
|
|
|
|
|
|
|
|
extraConfigLua = ''
|
2024-08-15 04:49:44 +00:00
|
|
|
require("config-local").setup(${helpers.toLuaConfig cfg.settings})
|
2024-02-06 23:54:37 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|