mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-19 08:39:50 +01:00
modules/wrapper: make all wrapper features configurable
following features have been made configurable `withRuby`, `withNodeJs`, `withPython3` and `python3Packages`
This commit is contained in:
parent
d9a984bf6f
commit
7647353c40
2 changed files with 32 additions and 3 deletions
|
@ -83,6 +83,7 @@ inputs: {
|
||||||
plugins = builtStartPlugins ++ builtOptPlugins;
|
plugins = builtStartPlugins ++ builtOptPlugins;
|
||||||
|
|
||||||
extraLuaPackages = ps: map (x: ps.${x}) vimOptions.luaPackages;
|
extraLuaPackages = ps: map (x: ps.${x}) vimOptions.luaPackages;
|
||||||
|
extraPython3Packages = ps: map (x: ps.${x}) vimOptions.python3Packages;
|
||||||
|
|
||||||
# wrap user's desired neovim package using the neovim wrapper from nixpkgs
|
# wrap user's desired neovim package using the neovim wrapper from nixpkgs
|
||||||
# the wrapper takes the following arguments:
|
# the wrapper takes the following arguments:
|
||||||
|
@ -95,8 +96,8 @@ inputs: {
|
||||||
# - customRC (string)
|
# - customRC (string)
|
||||||
# and returns the wrapped package
|
# and returns the wrapped package
|
||||||
neovim-wrapped = wrapNeovimUnstable vimOptions.package (makeNeovimConfig {
|
neovim-wrapped = wrapNeovimUnstable vimOptions.package (makeNeovimConfig {
|
||||||
inherit (vimOptions) viAlias vimAlias;
|
inherit (vimOptions) viAlias vimAlias withRuby withNodeJs withPython3;
|
||||||
inherit plugins extraLuaPackages;
|
inherit plugins extraLuaPackages extraPython3Packages;
|
||||||
customRC = vimOptions.builtConfigRC;
|
customRC = vimOptions.builtConfigRC;
|
||||||
});
|
});
|
||||||
in {
|
in {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.options) mkOption literalExpression;
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||||
inherit (lib.types) package bool str listOf attrsOf;
|
inherit (lib.types) package bool str listOf attrsOf;
|
||||||
inherit (lib.nvim.types) pluginsOpt extraPluginType;
|
inherit (lib.nvim.types) pluginsOpt extraPluginType;
|
||||||
in {
|
in {
|
||||||
|
@ -94,6 +94,21 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# this defaults to `true` in the wrapper
|
||||||
|
# and since we passs this value to the wrapper
|
||||||
|
# with an inherit, it should be `true` here as well
|
||||||
|
withRuby =
|
||||||
|
mkEnableOption ''
|
||||||
|
Ruby support in the Neovim wrapper.
|
||||||
|
''
|
||||||
|
// {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
withNodeJs = mkEnableOption ''
|
||||||
|
NodeJs support in the Neovim wrapper.
|
||||||
|
'';
|
||||||
|
|
||||||
luaPackages = mkOption {
|
luaPackages = mkOption {
|
||||||
type = listOf str;
|
type = listOf str;
|
||||||
default = [];
|
default = [];
|
||||||
|
@ -102,5 +117,18 @@ in {
|
||||||
List of lua packages to install.
|
List of lua packages to install.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
withPython3 = mkEnableOption ''
|
||||||
|
Python3 support in the Neovim wrapper.
|
||||||
|
'';
|
||||||
|
|
||||||
|
python3Packages = mkOption {
|
||||||
|
type = listOf str;
|
||||||
|
default = [];
|
||||||
|
example = literalExpression ''["pynvim"]'';
|
||||||
|
description = ''
|
||||||
|
List of python packages to install.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue