mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 02:11:33 +00:00
treewide: begin restructuring the module tree
This commit is contained in:
parent
e1835f6c46
commit
7c730a78e5
254 changed files with 749 additions and 664 deletions
5
modules/plugins/projects/default.nix
Normal file
5
modules/plugins/projects/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./project-nvim
|
||||
];
|
||||
}
|
19
modules/plugins/projects/project-nvim/config.nix
Normal file
19
modules/plugins/projects/project-nvim/config.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf nvim;
|
||||
|
||||
cfg = config.vim.projects.project-nvim;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = [
|
||||
"project-nvim"
|
||||
];
|
||||
|
||||
vim.luaConfigRC.project-nvim = nvim.dag.entryAnywhere ''
|
||||
require('project_nvim').setup(${nvim.lua.toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
}
|
6
modules/plugins/projects/project-nvim/default.nix
Normal file
6
modules/plugins/projects/project-nvim/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./project-nvim.nix
|
||||
];
|
||||
}
|
80
modules/plugins/projects/project-nvim/project-nvim.nix
Normal file
80
modules/plugins/projects/project-nvim/project-nvim.nix
Normal file
|
@ -0,0 +1,80 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkOption types mkRenamedOptionModule;
|
||||
in {
|
||||
imports = let
|
||||
renamedSetupOption = oldPath: newPath:
|
||||
mkRenamedOptionModule
|
||||
(["vim" "projects" "project-nvim"] ++ oldPath)
|
||||
(["vim" "projects" "project-nvim" "setupOpts"] ++ newPath);
|
||||
in [
|
||||
(renamedSetupOption ["manualMode"] ["manual_mode"])
|
||||
(renamedSetupOption ["detectionMethods"] ["detection_methods"])
|
||||
(renamedSetupOption ["patterns"] ["patterns"])
|
||||
(renamedSetupOption ["lspIgnored"] ["lsp_ignored"])
|
||||
(renamedSetupOption ["excludeDirs"] ["exclude_dirs"])
|
||||
(renamedSetupOption ["showHidden"] ["show_hidden"])
|
||||
(renamedSetupOption ["silentChdir"] ["silent_chdir"])
|
||||
(renamedSetupOption ["scopeChdir"] ["scope_chdir"])
|
||||
];
|
||||
|
||||
options.vim.projects.project-nvim = {
|
||||
enable = mkEnableOption "project-nvim for project management";
|
||||
|
||||
setupOpts = lib.nvim.types.mkPluginSetupOption "Project.nvim" {
|
||||
manual_mode = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "don't automatically change the root directory so the user has the option to manually do so using `:ProjectRoot` command";
|
||||
};
|
||||
|
||||
# detection methods should accept one or more strings from a list
|
||||
detection_methods = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = ["lsp" "pattern"];
|
||||
description = "Detection methods to use";
|
||||
};
|
||||
|
||||
# patterns
|
||||
patterns = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [".git" "_darcs" ".hg" ".bzr" ".svn" "Makefile" "package.json" "flake.nix" "cargo.toml"];
|
||||
description = "Patterns to use for pattern detection method";
|
||||
};
|
||||
|
||||
# table of lsp servers to ignore by name
|
||||
lsp_ignored = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
description = "LSP servers no ignore by name";
|
||||
};
|
||||
|
||||
exclude_dirs = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
description = "Directories to exclude from project root search";
|
||||
};
|
||||
|
||||
show_hidden = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Show hidden files in telescope picker";
|
||||
};
|
||||
|
||||
silent_chdir = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Silently change directory when changing project";
|
||||
};
|
||||
|
||||
scope_chdir = mkOption {
|
||||
type = types.enum ["global" "tab" "win"];
|
||||
default = "global";
|
||||
description = "What scope to change the directory";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue