mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-02 17:15:55 +00:00
core/build: opts
This commit is contained in:
parent
199a8b06c5
commit
6762516881
1 changed files with 96 additions and 0 deletions
96
modules/core/build/options.nix
Normal file
96
modules/core/build/options.nix
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkOption literalExpression;
|
||||
inherit (lib.types) package bool oneOf listOf lines str attrsOf attrs;
|
||||
inherit (lib.nvim.types) dagOf pluginsOpt extraPluginType;
|
||||
in {
|
||||
options.vim = {
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = pkgs.neovim-unwrapped;
|
||||
description = ''
|
||||
The neovim package to use. You will need to use an unwrapped package for this option to work as intended.
|
||||
'';
|
||||
};
|
||||
|
||||
viAlias = mkOption {
|
||||
description = "Enable vi alias";
|
||||
type = bool;
|
||||
default = true;
|
||||
};
|
||||
|
||||
vimAlias = mkOption {
|
||||
description = "Enable vim alias";
|
||||
type = bool;
|
||||
default = true;
|
||||
};
|
||||
|
||||
configRC = mkOption {
|
||||
description = "vimrc contents";
|
||||
type = oneOf [(dagOf lines) str];
|
||||
default = {};
|
||||
};
|
||||
|
||||
luaConfigRC = mkOption {
|
||||
description = "vim lua config";
|
||||
type = oneOf [(dagOf lines) str];
|
||||
default = {};
|
||||
};
|
||||
|
||||
builtConfigRC = mkOption {
|
||||
internal = true;
|
||||
type = lines;
|
||||
description = "The built config for neovim after resolving the DAG";
|
||||
};
|
||||
|
||||
startPlugins = pluginsOpt {
|
||||
default = [];
|
||||
description = "List of plugins to startup.";
|
||||
};
|
||||
|
||||
optPlugins = pluginsOpt {
|
||||
default = [];
|
||||
description = "List of plugins to optionally load";
|
||||
};
|
||||
|
||||
extraPlugins = mkOption {
|
||||
type = attrsOf extraPluginType;
|
||||
default = {};
|
||||
description = ''
|
||||
List of plugins and related config.
|
||||
Note that these are setup after builtin plugins.
|
||||
'';
|
||||
example = literalExpression ''
|
||||
with pkgs.vimPlugins; {
|
||||
aerial = {
|
||||
package = aerial-nvim;
|
||||
setup = "require('aerial').setup {}";
|
||||
};
|
||||
|
||||
harpoon = {
|
||||
package = harpoon;
|
||||
setup = "require('harpoon').setup {}";
|
||||
after = ["aerial"];
|
||||
};
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
luaPackages = mkOption {
|
||||
type = listOf str;
|
||||
default = [];
|
||||
description = ''
|
||||
List of lua packages to install.
|
||||
'';
|
||||
};
|
||||
|
||||
globals = mkOption {
|
||||
default = {};
|
||||
description = "Set containing global variable values";
|
||||
type = attrs;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue