mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-30 00:26:45 +00:00
Compare commits
No commits in common. "d48f52f065c24ad1e23b8704f0c0c68c3d2c08be" and "fa660627fcbdc962790501fb7c8edb517e256620" have entirely different histories.
d48f52f065
...
fa660627fc
1 changed files with 25 additions and 27 deletions
|
@ -9,7 +9,7 @@ inputs: {
|
||||||
inherit (pkgs) vimPlugins;
|
inherit (pkgs) vimPlugins;
|
||||||
inherit (lib.strings) isString toString;
|
inherit (lib.strings) isString toString;
|
||||||
inherit (lib.lists) filter map concatLists;
|
inherit (lib.lists) filter map concatLists;
|
||||||
inherit (lib.attrsets) recursiveUpdate;
|
inherit (lib.attrsets) recursiveUpdate getAttr;
|
||||||
inherit (builtins) baseNameOf;
|
inherit (builtins) baseNameOf;
|
||||||
|
|
||||||
# import modules.nix with `check`, `pkgs` and `lib` as arguments
|
# import modules.nix with `check`, `pkgs` and `lib` as arguments
|
||||||
|
@ -32,21 +32,14 @@ inputs: {
|
||||||
# build a vim plugin with the given name and arguments
|
# build a vim plugin with the given name and arguments
|
||||||
# if the plugin is nvim-treesitter, warn the user to use buildTreesitterPlug
|
# if the plugin is nvim-treesitter, warn the user to use buildTreesitterPlug
|
||||||
# instead
|
# instead
|
||||||
buildPlug = attrs: let
|
buildPlug = {pname, ...} @ attrs: let
|
||||||
src = inputs."plugin-${attrs.pname}";
|
src = getAttr ("plugin-" + pname) inputs;
|
||||||
in
|
in
|
||||||
pkgs.stdenvNoCC.mkDerivation ({
|
pkgs.stdenvNoCC.mkDerivation ({
|
||||||
version = src.shortRev or src.shortDirtyRev or "dirty";
|
version = src.shortRev or src.shortDirtyRev or "dirty";
|
||||||
|
|
||||||
inherit src;
|
inherit src;
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs.vimUtils; [
|
|
||||||
vimCommandCheckHook
|
|
||||||
vimGenDocHook
|
|
||||||
neovimRequireCheckHook
|
|
||||||
];
|
|
||||||
passthru.vimPlugin = true;
|
|
||||||
|
|
||||||
buildPhase = lib.optionalString vimOptions.byteCompileLua ''
|
buildPhase = lib.optionalString vimOptions.byteCompileLua ''
|
||||||
runHook preBuild
|
runHook preBuild
|
||||||
find . -type f -name '*.lua' -exec luajit -bd -- {} {} \;
|
find . -type f -name '*.lua' -exec luajit -bd -- {} {} \;
|
||||||
|
@ -66,25 +59,30 @@ inputs: {
|
||||||
|
|
||||||
buildTreesitterPlug = grammars: vimPlugins.nvim-treesitter.withPlugins (_: grammars);
|
buildTreesitterPlug = grammars: vimPlugins.nvim-treesitter.withPlugins (_: grammars);
|
||||||
|
|
||||||
pluginBuilders = {
|
buildConfigPlugins = plugins:
|
||||||
nvim-treesitter = buildTreesitterPlug vimOptions.treesitter.grammars;
|
map
|
||||||
flutter-tools-patched =
|
(plug: (
|
||||||
|
if (isString plug)
|
||||||
|
then
|
||||||
|
(
|
||||||
|
if (plug == "nvim-treesitter")
|
||||||
|
then (buildTreesitterPlug vimOptions.treesitter.grammars)
|
||||||
|
else if (plug == "flutter-tools-patched")
|
||||||
|
then
|
||||||
|
(
|
||||||
buildPlug
|
buildPlug
|
||||||
{
|
{
|
||||||
pname = "flutter-tools";
|
pname = "flutter-tools";
|
||||||
patches = [../patches/flutter-tools.patch];
|
patches = [../patches/flutter-tools.patch];
|
||||||
};
|
}
|
||||||
};
|
|
||||||
|
|
||||||
buildConfigPlugins = plugins:
|
|
||||||
map
|
|
||||||
(
|
|
||||||
plug:
|
|
||||||
if (isString plug)
|
|
||||||
then pluginBuilders.${plug} or (buildPlug {pname = plug;})
|
|
||||||
else plug
|
|
||||||
)
|
)
|
||||||
(filter (f: f != null) plugins);
|
else buildPlug {pname = plug;}
|
||||||
|
)
|
||||||
|
else plug
|
||||||
|
))
|
||||||
|
(filter
|
||||||
|
(f: f != null)
|
||||||
|
plugins);
|
||||||
|
|
||||||
# built (or "normalized") plugins that are modified
|
# built (or "normalized") plugins that are modified
|
||||||
builtStartPlugins = buildConfigPlugins vimOptions.startPlugins;
|
builtStartPlugins = buildConfigPlugins vimOptions.startPlugins;
|
||||||
|
|
Loading…
Reference in a new issue