fix: infinite recursion

This commit is contained in:
Marc Jakobi 2024-02-22 23:42:49 +01:00
parent c102a8311e
commit 14aac92867
2 changed files with 33 additions and 8 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
.luarc.json
result/

View file

@ -12,6 +12,29 @@
flake-parts, flake-parts,
}: }:
flake-parts.lib.mkFlake {inherit inputs;} { flake-parts.lib.mkFlake {inherit inputs;} {
systems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
"aarch64-linux"
];
perSystem = {system, ...}: let
pkgs = import nixpkgs {
inherit system;
overlays = [
self.overlays.default
];
};
luarc = pkgs.mk-luarc-json {
plugins = with pkgs.vimPlugins; [telescope-nvim fidget-nvim];
};
in {
devShells.default = pkgs.mkShell {
shellHook = ''
ln -fs ${pkgs.luarc-to-json luarc} .luarc.json
'';
};
};
flake = { flake = {
overlays.default = final: prev: { overlays.default = final: prev: {
mk-luarc = { mk-luarc = {
@ -21,15 +44,14 @@
plugins ? [], plugins ? [],
lua-version ? "5.1", lua-version ? "5.1",
}: let }: let
lib = final.lib;
partitions = builtins.partition (plugin: partitions = builtins.partition (plugin:
builtins.hasAttr "vimPlugin" plugin builtins.hasAttr "vimPlugin" plugin
&& plugin.vimPlugin && plugin.vimPlugin
|| plugin.pname == "nvim-treesitter") || plugin.pname == "nvim-treesitter")
plugins; plugins;
plugins = partitions.right; nvim-plugins = partitions.right;
rocks = partitions.wrong; rocks = partitions.wrong;
plugin-luadirs = builtins.map (plugin: "${plugin}/lua") plugins; plugin-luadirs = builtins.map (plugin: "${plugin}/lua") nvim-plugins;
pkg-libdirs = builtins.map (pkg: "${pkg}/lib/lua/${lua-version}") rocks; pkg-libdirs = builtins.map (pkg: "${pkg}/lib/lua/${lua-version}") rocks;
pkg-sharedirs = builtins.map (pkg: "${pkg}/share/lua/${lua-version}") rocks; pkg-sharedirs = builtins.map (pkg: "${pkg}/share/lua/${lua-version}") rocks;
in { in {
@ -64,7 +86,8 @@
}; };
}; };
}; };
luarc-to-json = luarc: final.runCommand ".luarc.json" { luarc-to-json = luarc:
final.runCommand ".luarc.json" {
buildInputs = [ buildInputs = [
final.jq final.jq
]; ];