2022-10-25 01:15:09 +02:00
|
|
|
{
|
2023-02-20 11:42:13 +01:00
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
cfg = config.plugins.project-nvim;
|
|
|
|
helpers = import ../helpers.nix {inherit lib pkgs;};
|
|
|
|
in {
|
|
|
|
options.plugins.project-nvim =
|
|
|
|
helpers.extraOptionsOptions
|
|
|
|
// {
|
|
|
|
enable = mkEnableOption "project.nvim";
|
2022-10-25 01:15:09 +02:00
|
|
|
|
2023-02-20 11:42:13 +01:00
|
|
|
package = helpers.mkPackageOption "project-nvim" pkgs.vimPlugins.project-nvim;
|
2023-01-19 10:45:15 +00:00
|
|
|
|
2023-02-20 11:42:13 +01:00
|
|
|
manualMode = mkOption {
|
|
|
|
type = types.nullOr types.bool;
|
|
|
|
default = null;
|
|
|
|
};
|
2022-10-25 01:15:09 +02:00
|
|
|
|
2023-02-20 11:42:13 +01:00
|
|
|
detectionMethods = mkOption {
|
|
|
|
type = types.nullOr (types.listOf types.str);
|
|
|
|
default = null;
|
|
|
|
};
|
2022-10-25 01:15:09 +02:00
|
|
|
|
2023-02-20 11:42:13 +01:00
|
|
|
patterns = mkOption {
|
|
|
|
type = types.nullOr (types.listOf types.str);
|
|
|
|
default = null;
|
|
|
|
};
|
2022-10-25 01:15:09 +02:00
|
|
|
|
2023-02-20 11:42:13 +01:00
|
|
|
ignoreLsp = mkOption {
|
|
|
|
type = types.nullOr (types.listOf types.str);
|
|
|
|
default = null;
|
|
|
|
};
|
2022-10-25 01:15:09 +02:00
|
|
|
|
2023-02-20 11:42:13 +01:00
|
|
|
excludeDirs = mkOption {
|
|
|
|
type = types.nullOr (types.listOf types.str);
|
|
|
|
default = null;
|
|
|
|
};
|
2022-10-25 01:15:09 +02:00
|
|
|
|
2023-02-20 11:42:13 +01:00
|
|
|
showHidden = mkOption {
|
|
|
|
type = types.nullOr types.bool;
|
|
|
|
default = null;
|
|
|
|
};
|
2022-10-25 01:15:09 +02:00
|
|
|
|
2023-02-20 11:42:13 +01:00
|
|
|
silentChdir = mkOption {
|
|
|
|
type = types.nullOr types.bool;
|
|
|
|
default = null;
|
|
|
|
};
|
2022-10-25 01:15:09 +02:00
|
|
|
|
2023-02-20 11:42:13 +01:00
|
|
|
scopeChdir = mkOption {
|
|
|
|
type = types.nullOr (types.enum ["global" "tab" "win"]);
|
|
|
|
default = null;
|
|
|
|
};
|
2022-10-25 01:15:09 +02:00
|
|
|
|
2023-02-20 11:42:13 +01:00
|
|
|
dataPath = mkOption {
|
|
|
|
type = types.nullOr (types.either types.str helpers.rawType);
|
|
|
|
default = null;
|
|
|
|
};
|
2022-10-25 01:15:09 +02:00
|
|
|
};
|
2022-12-01 20:57:06 +01:00
|
|
|
|
2023-02-20 11:42:13 +01:00
|
|
|
config = let
|
|
|
|
options =
|
|
|
|
{
|
2022-10-25 01:15:09 +02:00
|
|
|
manual_mode = cfg.manualMode;
|
|
|
|
detection_methods = cfg.detectionMethods;
|
|
|
|
patterns = cfg.patterns;
|
|
|
|
ignore_lsp = cfg.ignoreLsp;
|
|
|
|
exclude_dirs = cfg.excludeDirs;
|
|
|
|
show_hidden = cfg.showHidden;
|
|
|
|
silent_chdir = cfg.silentChdir;
|
|
|
|
scope_schdir = cfg.scopeChdir;
|
|
|
|
data_path = cfg.dataPath;
|
2023-02-20 11:42:13 +01:00
|
|
|
}
|
|
|
|
// cfg.extraOptions;
|
|
|
|
in
|
2022-10-25 01:15:09 +02:00
|
|
|
mkIf cfg.enable {
|
2023-02-20 11:42:13 +01:00
|
|
|
extraPlugins = [cfg.package];
|
2022-10-25 01:15:09 +02:00
|
|
|
|
|
|
|
extraConfigLua = ''
|
|
|
|
require('project_nvim').setup(${helpers.toLuaObject options})
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|