From ebfd3da415ae9ecc73bf565336d45d4d114d0c09 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 19 Jun 2024 14:27:43 +0200 Subject: [PATCH] vimPlugins.codesnap-nvim: init at 2024-05-08 --- .../editors/vim/plugins/overrides.nix | 47 +++++++++++++++++++ .../editors/vim/plugins/vim-plugin-names | 5 +- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix index 2c8147cfce73..d65f8c50c7b2 100644 --- a/pkgs/applications/editors/vim/plugins/overrides.nix +++ b/pkgs/applications/editors/vim/plugins/overrides.nix @@ -60,6 +60,9 @@ , zsh , # codeium-nvim dependencies codeium +, # codesnap-nvim dependencies + clang +, libuv , # command-t dependencies getconf , ruby @@ -400,6 +403,50 @@ ''; }; + codesnap-nvim = + let + version = "1.3.1"; + src = fetchFromGitHub { + owner = "mistricky"; + repo = "codesnap.nvim"; + rev = "refs/tags/v${version}"; + hash = "sha256-nS/bAWsBQ1L4M9437Yp6FdmHoogzalKlLIAXnRZyMp0="; + }; + codesnap-lib = rustPlatform.buildRustPackage { + pname = "codesnap-lib"; + inherit version src; + + sourceRoot = "${src.name}/generator"; + + cargoHash = "sha256-FTQl5WIGEf+RQKYJ4BbIE3cCeN+NYUp7VXIrpxB05tU="; + + nativeBuildInputs = [ + pkg-config + rustPlatform.bindgenHook + ]; + + buildInputs = [ + libuv.dev + ] ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.AppKit + ]; + }; + in + buildVimPlugin { + pname = "codesnap.nvim"; + inherit version src; + + # https://github.com/mistricky/codesnap.nvim/blob/main/scripts/build_generator.sh + postInstall = let + extension = if stdenv.isDarwin then "dylib" else "so"; + in '' + cp ${codesnap-lib}/lib/libgenerator.${extension} lua/generator.so + ''; + + doInstallCheck = true; + nvimRequireCheck = "codesnap"; + }; + command-t = super.command-t.overrideAttrs { nativeBuildInputs = [ getconf ruby ]; buildPhase = '' diff --git a/pkgs/applications/editors/vim/plugins/vim-plugin-names b/pkgs/applications/editors/vim/plugins/vim-plugin-names index 25b19fcf8f8d..dbfa68d78a9f 100644 --- a/pkgs/applications/editors/vim/plugins/vim-plugin-names +++ b/pkgs/applications/editors/vim/plugins/vim-plugin-names @@ -191,6 +191,7 @@ https://github.com/neoclide/coc.nvim/,release, https://github.com/manicmaniac/coconut.vim/,HEAD, https://github.com/Exafunction/codeium.nvim/,HEAD, https://github.com/Exafunction/codeium.vim/,HEAD, +https://github.com/mistricky/codesnap.nvim/,HEAD, https://github.com/gorbit99/codewindow.nvim/,HEAD, https://github.com/metakirby5/codi.vim/,, https://github.com/tjdevries/colorbuddy.nvim/,, @@ -691,7 +692,7 @@ https://github.com/yamatsum/nvim-nonicons/,, https://github.com/rcarriga/nvim-notify/,, https://github.com/LhKipp/nvim-nu/,HEAD, https://github.com/ojroques/nvim-osc52/,, -https://github.com/julienvincent/nvim-paredit,, +https://github.com/julienvincent/nvim-paredit/,, https://github.com/gpanders/nvim-parinfer/,HEAD, https://github.com/gennaro-tedesco/nvim-peekup/,, https://github.com/yorickpeterse/nvim-pqf/,HEAD, @@ -760,7 +761,7 @@ https://github.com/drewtempelmeyer/palenight.vim/,, https://github.com/JoosepAlviste/palenightfall.nvim/,, https://github.com/roobert/palette.nvim/,HEAD, https://github.com/NLKNguyen/papercolor-theme/,, -https://github.com/dundalek/parpar.nvim,, +https://github.com/dundalek/parpar.nvim/,, https://github.com/tmsvg/pear-tree/,, https://github.com/steelsojka/pears.nvim/,, https://github.com/olimorris/persisted.nvim/,HEAD,