mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-25 05:44:40 +00:00
wrapper/environment: add vim.appName to configure NVIM_APPNAME
This commit is contained in:
parent
0c9b4d0d80
commit
c0b6c55b19
3 changed files with 50 additions and 21 deletions
|
|
@ -1,7 +1,6 @@
|
|||
# Release Notes {#ch-release-notes}
|
||||
|
||||
This section lists the release notes for tagged version of **nvf** and the
|
||||
current main current main branch
|
||||
This section lists the release notes for tagged version of **nvf** and the current main branch
|
||||
|
||||
```{=include=} chapters
|
||||
rl-0.1.md
|
||||
|
|
@ -11,4 +10,5 @@ rl-0.4.md
|
|||
rl-0.5.md
|
||||
rl-0.6.md
|
||||
rl-0.7.md
|
||||
rl-0.8.md
|
||||
```
|
||||
|
|
|
|||
|
|
@ -7,7 +7,13 @@
|
|||
}: let
|
||||
inherit (pkgs) vimPlugins;
|
||||
inherit (lib.trivial) flip;
|
||||
inherit (builtins) filter isString hasAttr getAttr;
|
||||
inherit
|
||||
(builtins)
|
||||
filter
|
||||
isString
|
||||
hasAttr
|
||||
getAttr
|
||||
;
|
||||
|
||||
getPin = flip getAttr (pkgs.callPackages ../../../npins/sources.nix {});
|
||||
|
||||
|
|
@ -52,21 +58,23 @@
|
|||
};
|
||||
|
||||
buildConfigPlugins = plugins:
|
||||
map (plug:
|
||||
if (isString plug)
|
||||
then
|
||||
if hasAttr plug config.vim.pluginOverrides
|
||||
map (
|
||||
plug:
|
||||
if (isString plug)
|
||||
then
|
||||
(let
|
||||
plugin = config.vim.pluginOverrides.${plug};
|
||||
in
|
||||
if (lib.isType "flake" plugin)
|
||||
then plugin // {name = plug;}
|
||||
else plugin)
|
||||
else pluginBuilders.${plug} or (noBuildPlug plug)
|
||||
else plug) (
|
||||
filter (f: f != null) plugins
|
||||
);
|
||||
if hasAttr plug config.vim.pluginOverrides
|
||||
then
|
||||
(
|
||||
let
|
||||
plugin = config.vim.pluginOverrides.${plug};
|
||||
in
|
||||
if (lib.isType "flake" plugin)
|
||||
then plugin // {name = plug;}
|
||||
else plugin
|
||||
)
|
||||
else pluginBuilders.${plug} or (noBuildPlug plug)
|
||||
else plug
|
||||
) (filter (f: f != null) plugins);
|
||||
|
||||
# Wrap the user's desired (unwrapped) Neovim package with arguments that'll be used to
|
||||
# generate a wrapped Neovim package.
|
||||
|
|
@ -76,7 +84,7 @@
|
|||
start = buildConfigPlugins config.vim.startPlugins;
|
||||
opt = buildConfigPlugins config.vim.optPlugins;
|
||||
};
|
||||
appName = "nvf";
|
||||
appName = config.vim.appName;
|
||||
extraBinPath = config.vim.extraPackages;
|
||||
initLua = config.vim.builtLuaConfigRC;
|
||||
luaFiles = config.vim.extraLuaFiles;
|
||||
|
|
@ -103,7 +111,11 @@
|
|||
# or module consumption.
|
||||
neovim = pkgs.symlinkJoin {
|
||||
name = "nvf-with-helpers";
|
||||
paths = [neovim-wrapped printConfig printConfigPath];
|
||||
paths = [
|
||||
neovim-wrapped
|
||||
printConfig
|
||||
printConfigPath
|
||||
];
|
||||
postBuild = "echo Helpers added";
|
||||
|
||||
# Allow evaluating config.vim, i.e., config.vim from the packages' passthru
|
||||
|
|
|
|||
|
|
@ -4,10 +4,27 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib.options) mkOption mkEnableOption literalMD;
|
||||
inherit (lib.types) package bool str listOf attrsOf;
|
||||
inherit
|
||||
(lib.types)
|
||||
package
|
||||
bool
|
||||
str
|
||||
listOf
|
||||
attrsOf
|
||||
;
|
||||
inherit (lib.nvim.types) pluginsOpt extraPluginType;
|
||||
in {
|
||||
options.vim = {
|
||||
appName = mkOption {
|
||||
type = str;
|
||||
default = "nvf";
|
||||
description = ''
|
||||
The neovim application name corresponding to the
|
||||
`NVIM_APPNAME`
|
||||
[environment variable](https://neovim.io/doc/user/starting/#_nvim_appname).
|
||||
'';
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = pkgs.neovim-unwrapped;
|
||||
|
|
@ -101,7 +118,7 @@ in {
|
|||
extraPackages = mkOption {
|
||||
type = listOf package;
|
||||
default = [];
|
||||
example = ''[pkgs.fzf pkgs.ripgrep]'';
|
||||
example = "[pkgs.fzf pkgs.ripgrep]";
|
||||
description = ''
|
||||
List of additional packages to make available to the Neovim
|
||||
wrapper.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue