From 6b1aa6159ff250e582e0118594ddfb0eb10d59d9 Mon Sep 17 00:00:00 2001 From: BirdeeHub Date: Tue, 3 Sep 2024 18:45:43 -0700 Subject: [PATCH] vimPlugins.lze: init at 0.1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I made this, and I almost completely deleted it because I was fully on board with lz-n again. However, I have been using it and lz-n simultaneosly and trying them out. I wish to publish lze after all. I like it a lot. It works completely differently from lz-n and has a different handler api, but has a similar plugin spec. Update pkgs/development/lua-modules/overrides.nix Co-authored-by: GaƩtan Lepage <33058747+GaetanLepage@users.noreply.github.com> --- maintainers/scripts/luarocks-packages.csv | 1 + .../editors/vim/plugins/overrides.nix | 2 ++ .../lua-modules/generated-packages.nix | 23 +++++++++++++++++++ pkgs/development/lua-modules/overrides.nix | 11 +++++++++ 4 files changed, 37 insertions(+) diff --git a/maintainers/scripts/luarocks-packages.csv b/maintainers/scripts/luarocks-packages.csv index 26b5dc52be6f..4d1ed177c1c4 100644 --- a/maintainers/scripts/luarocks-packages.csv +++ b/maintainers/scripts/luarocks-packages.csv @@ -105,6 +105,7 @@ luv,,,,1.48.0-2,, lush.nvim,,,https://luarocks.org/dev,,,teto lyaml,,,,,,lblasc lz.n,,,,,,mrcjkb +lze,,,,,,birdee lzn-auto-require,,,,,,mrcjkb magick,,,,,5.1,donovanglover markdown,,,,,, diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix index 976c5e9d93ef..b6ba6d533877 100644 --- a/pkgs/applications/editors/vim/plugins/overrides.nix +++ b/pkgs/applications/editors/vim/plugins/overrides.nix @@ -1015,6 +1015,8 @@ lz-n = neovimUtils.buildNeovimPlugin { luaAttr = "lz-n"; }; + lze = neovimUtils.buildNeovimPlugin { luaAttr = "lze"; }; + lzn-auto-require = neovimUtils.buildNeovimPlugin { luaAttr = "lzn-auto-require"; }; magma-nvim-goose = buildVimPlugin { diff --git a/pkgs/development/lua-modules/generated-packages.nix b/pkgs/development/lua-modules/generated-packages.nix index aec5d2b0b896..c57850a86dad 100644 --- a/pkgs/development/lua-modules/generated-packages.nix +++ b/pkgs/development/lua-modules/generated-packages.nix @@ -2512,6 +2512,29 @@ buildLuarocksPackage { }; }) {}; +lze = callPackage({ buildLuarocksPackage, fetchurl, fetchzip, luaOlder }: +buildLuarocksPackage { + pname = "lze"; + version = "0.1.1-1"; + knownRockspec = (fetchurl { + url = "mirror://luarocks/lze-0.1.1-1.rockspec"; + sha256 = "0rih9kgx846qhp1fmsqlnp8y08kv4hp8gl9dwykz4zr0zljy94j3"; + }).outPath; + src = fetchzip { + url = "https://github.com/BirdeeHub/lze/archive/v0.1.1.zip"; + sha256 = "1s6n61jabsv94s37xd5g0y7fxhficc4rwsklgsmzajravpgy60a8"; + }; + + disabled = luaOlder "5.1"; + + meta = { + homepage = "https://github.com/BirdeeHub/lze"; + description = "A lazy-loading library for neovim, inspired by, but different from, nvim-neorocks/lz.n"; + maintainers = with lib.maintainers; [ birdee ]; + license.fullName = "GPL-2+"; + }; +}) {}; + lzn-auto-require = callPackage({ buildLuarocksPackage, fetchurl, fetchzip, luaOlder, lz-n }: buildLuarocksPackage { pname = "lzn-auto-require"; diff --git a/pkgs/development/lua-modules/overrides.nix b/pkgs/development/lua-modules/overrides.nix index 358560cfc771..ed25e552cef9 100644 --- a/pkgs/development/lua-modules/overrides.nix +++ b/pkgs/development/lua-modules/overrides.nix @@ -544,6 +544,17 @@ in ''; }); + lze = prev.lze.overrideAttrs(oa: { + doCheck = lua.luaversion == "5.1"; + nativeCheckInputs = [ final.nlua final.busted ]; + checkPhase = '' + runHook preCheck + export HOME=$(mktemp -d) + busted --lua=nlua + runHook postCheck + ''; + }); + neotest = prev.neotest.overrideAttrs(oa: { # A few tests fail for strange reasons on darwin doCheck = !stdenv.isDarwin;