Skip to content

Commit

Permalink
build: use lz.n flake
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Jun 29, 2024
1 parent 380f9fb commit 90b0ba3
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 58 deletions.
60 changes: 30 additions & 30 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,13 @@
];
};

rocks-nvim = rocks-nvim-flake.packages.${system}.rocks-nvim;
lz-n = lz-n-flake.packages.${system}.lz-n-luaPackage;

luarc = pkgs.mk-luarc {
nvim = pkgs.neovim-nightly;
plugins = with pkgs.lua51Packages; [
rocks-nvim-flake.packages.${system}.rocks-nvim
plugins = [
rocks-nvim
lz-n
];
};
Expand Down Expand Up @@ -102,6 +105,8 @@
++ (with pkgs; [
busted-nlua
lua-language-server
rocks-nvim
lz-n
]);
};
in {
Expand Down Expand Up @@ -129,7 +134,7 @@
};
};
flake = {
overlays.default = import ./nix/overlay.nix {inherit self rocks-nvim-flake;};
overlays.default = import ./nix/overlay.nix {inherit self inputs;};
};
};
}
30 changes: 5 additions & 25 deletions nix/overlay.nix
Original file line number Diff line number Diff line change
@@ -1,33 +1,13 @@
{
self,
rocks-nvim-flake,
inputs,
}: final: prev: let
name = "rocks-lazy.nvim";

luaPackage-override = luaself: luaprev: {
rocks-nvim = rocks-nvim-flake.packages.${final.system}.rocks-nvim;
rocks-nvim = inputs.rocks-nvim-flake.packages.${final.system}.rocks-nvim;

lz-n = luaself.callPackage ({
buildLuarocksPackage,
fetchurl,
fetchzip,
luaOlder,
}:
buildLuarocksPackage {
pname = "lz.n";
version = "1.2.4-1";
knownRockspec =
(fetchurl {
url = "mirror://luarocks/lz.n-1.2.4-1.rockspec";
sha256 = "sha256-DR0wr7wczl0P1PEMDSc9w9gU30KstX/rWBjAcx97k7A=";
})
.outPath;
src = fetchzip {
url = "https://github.com/nvim-neorocks/lz.n/archive/v1.2.4.zip";
sha256 = "sha256-T4gRlf7GoiPhwvQnvomKLU4y21v1zFm3YcKvsdgkSds=";
};
disabled = luaOlder "5.1";
}) {};
lz-n = inputs.lz-n-flake.packages.${final.system}.lz-n-luaPackage;

rocks-lazy-nvim = luaself.callPackage ({
luaOlder,
Expand Down Expand Up @@ -58,9 +38,9 @@
luajitPackages = final.luajit.pkgs;

neovim-with-rocks = let
rocks = rocks-nvim-flake.packages.${final.system}.rocks-nvim;
rocks = inputs.rocks-nvim-flake.packages.${final.system}.rocks-nvim;
rocks-lazy = final.luajitPackages.rocks-lazy-nvim;
lz-n = final.luajitPackages.lz-n;
lz-n = inputs.lz-n-flake.packages.${final.system}.lz-n-luaPackage;
neovimConfig = final.neovimUtils.makeNeovimConfig {
withPython3 = true;
viAlias = false;
Expand Down
2 changes: 2 additions & 0 deletions spec/rocks_lazy_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ vim.g.lz_n = {
load = function() end,
}

vim.cmd.packadd = function() end

local tempdir = vim.fn.tempname()
local config_path = vim.fs.joinpath(tempdir, "rocks.toml")

Expand Down

0 comments on commit 90b0ba3

Please sign in to comment.