From bb72dfdb81dbcd338658a11c2e46e357b8b221a6 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Mon, 17 Jul 2023 15:10:36 -0400 Subject: [PATCH] vimPlugins.image-nvim: init at 2023-07-17 Depends on https://github.com/NixOS/nixpkgs/pull/243687 --- .../editors/vim/plugins/generated.nix | 12 ++++++++++++ .../editors/vim/plugins/overrides.nix | 19 +++++++++++++++++++ .../plugins/patches/image-nvim/magick.patch | 11 +++++++++++ .../editors/vim/plugins/vim-plugin-names | 1 + 4 files changed, 43 insertions(+) create mode 100644 pkgs/applications/editors/vim/plugins/patches/image-nvim/magick.patch diff --git a/pkgs/applications/editors/vim/plugins/generated.nix b/pkgs/applications/editors/vim/plugins/generated.nix index c1a1bc5ebec8..67cde22eb848 100644 --- a/pkgs/applications/editors/vim/plugins/generated.nix +++ b/pkgs/applications/editors/vim/plugins/generated.nix @@ -4244,6 +4244,18 @@ final: prev: meta.homepage = "https://github.com/edwinb/idris2-vim/"; }; + image-nvim = buildVimPluginFrom2Nix { + pname = "image.nvim"; + version = "2023-07-17"; + src = fetchFromGitHub { + owner = "3rd"; + repo = "image.nvim"; + rev = "24c312191ca6bc04e45610a7bcb984d3bf208820"; + sha256 = "1fy024nd01wryrasibc4b8divcfzx3a7xxfzx968l4a4l1q3l6vc"; + }; + meta.homepage = "https://github.com/3rd/image.nvim/"; + }; + impatient-nvim = buildVimPluginFrom2Nix { pname = "impatient.nvim"; version = "2023-05-05"; diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix index d0cd29215b3a..f14cf064c8bd 100644 --- a/pkgs/applications/editors/vim/plugins/overrides.nix +++ b/pkgs/applications/editors/vim/plugins/overrides.nix @@ -125,6 +125,7 @@ # must be lua51Packages , luaPackages +, luajitPackages }: self: super: { @@ -600,6 +601,24 @@ self: super: { }; + image-nvim = super.image-nvim.overrideAttrs { + dependencies = with self; [ + nvim-treesitter + nvim-treesitter-parsers.markdown_inline + nvim-treesitter-parsers.norg + ]; + + # Add magick to package.path + patches = [ ./patches/image-nvim/magick.patch ]; + + postPatch = '' + substituteInPlace lua/image/magick.lua \ + --replace @nix_magick@ ${luajitPackages.magick} + ''; + + nvimRequireCheck = "image"; + }; + jedi-vim = super.jedi-vim.overrideAttrs { # checking for python3 support in vim would be neat, too, but nobody else seems to care buildInputs = [ python3.pkgs.jedi ]; diff --git a/pkgs/applications/editors/vim/plugins/patches/image-nvim/magick.patch b/pkgs/applications/editors/vim/plugins/patches/image-nvim/magick.patch new file mode 100644 index 000000000000..43d93ddbd77e --- /dev/null +++ b/pkgs/applications/editors/vim/plugins/patches/image-nvim/magick.patch @@ -0,0 +1,11 @@ +diff --git a/lua/image/magick.lua b/lua/image/magick.lua +index a0c5a64..e3b57d4 100644 +--- a/lua/image/magick.lua ++++ b/lua/image/magick.lua +@@ -1,3 +1,6 @@ ++package.path = package.path .. ";@nix_magick@/share/lua/5.1/?/init.lua;" ++package.path = package.path .. ";@nix_magick@/share/lua/5.1/?.lua;" ++ + local has_magick, magick = pcall(require, "magick") + + ---@return MagickImage diff --git a/pkgs/applications/editors/vim/plugins/vim-plugin-names b/pkgs/applications/editors/vim/plugins/vim-plugin-names index 4f541e7a2f94..0577fb46ec6b 100644 --- a/pkgs/applications/editors/vim/plugins/vim-plugin-names +++ b/pkgs/applications/editors/vim/plugins/vim-plugin-names @@ -355,6 +355,7 @@ https://github.com/mboughaba/i3config.vim/,, https://github.com/cocopon/iceberg.vim/,, https://github.com/idris-hackers/idris-vim/,, https://github.com/edwinb/idris2-vim/,, +https://github.com/3rd/image.nvim/,HEAD, https://github.com/lewis6991/impatient.nvim/,, https://github.com/smjonas/inc-rename.nvim/,HEAD, https://github.com/nishigori/increment-activator/,,