feat: add support for share
directories
This commit is contained in:
parent
6c5c893f0d
commit
c102a8311e
2 changed files with 14 additions and 8 deletions
|
@ -11,8 +11,9 @@ which takes an attrset with the following arguments:
|
||||||
- `nvim`: The neovim package. Defaults to `neovim-unwrapped`.
|
- `nvim`: The neovim package. Defaults to `neovim-unwrapped`.
|
||||||
- `neodev-types`: neodev.nvim types to add to the `workspace.library`.
|
- `neodev-types`: neodev.nvim types to add to the `workspace.library`.
|
||||||
Defaults to `"stable"`.
|
Defaults to `"stable"`.
|
||||||
- Plugins: List of Neovim plugins and/or luarocks packages.
|
- `plugins`: List of Neovim plugins and/or luarocks packages.
|
||||||
Defaults to an empty list.
|
Defaults to an empty list.
|
||||||
|
- `lua-version`: Defaults to `"5.1"`.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
|
|
19
flake.nix
19
flake.nix
|
@ -19,16 +19,19 @@
|
||||||
nvim ? final.neovim-unwrapped,
|
nvim ? final.neovim-unwrapped,
|
||||||
neodev-types ? "stable",
|
neodev-types ? "stable",
|
||||||
plugins ? [],
|
plugins ? [],
|
||||||
|
lua-version ? "5.1",
|
||||||
}: let
|
}: let
|
||||||
lib = final.lib;
|
lib = final.lib;
|
||||||
plugin-lib-dirs = lib.lists.map (plugin:
|
partitions = builtins.partition (plugin:
|
||||||
if
|
|
||||||
builtins.hasAttr "vimPlugin" plugin
|
builtins.hasAttr "vimPlugin" plugin
|
||||||
&& plugin.vimPlugin
|
&& plugin.vimPlugin
|
||||||
|| plugin.pname == "nvim-treesitter"
|
|| plugin.pname == "nvim-treesitter")
|
||||||
then "${plugin}/lua"
|
plugins;
|
||||||
else "${plugin}/lib/lua/5.1")
|
plugins = partitions.right;
|
||||||
plugins;
|
rocks = partitions.wrong;
|
||||||
|
plugin-luadirs = builtins.map (plugin: "${plugin}/lua") plugins;
|
||||||
|
pkg-libdirs = builtins.map (pkg: "${pkg}/lib/lua/${lua-version}") rocks;
|
||||||
|
pkg-sharedirs = builtins.map (pkg: "${pkg}/share/lua/${lua-version}") rocks;
|
||||||
in {
|
in {
|
||||||
runtime.version = "LuaJIT";
|
runtime.version = "LuaJIT";
|
||||||
Lua = {
|
Lua = {
|
||||||
|
@ -43,7 +46,9 @@
|
||||||
"\${3rd}/busted/library"
|
"\${3rd}/busted/library"
|
||||||
"\${3rd}/luassert/library"
|
"\${3rd}/luassert/library"
|
||||||
]
|
]
|
||||||
++ plugin-lib-dirs;
|
++ plugin-luadirs
|
||||||
|
++ pkg-libdirs
|
||||||
|
++ pkg-sharedirs;
|
||||||
ignoreDir = [
|
ignoreDir = [
|
||||||
".git"
|
".git"
|
||||||
".github"
|
".github"
|
||||||
|
|
Loading…
Reference in a new issue