vimPlugins.codesnap-nvim: move out of vim generated
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
nix-update-script,
|
||||
pkg-config,
|
||||
rustPlatform,
|
||||
vimUtils,
|
||||
libuv,
|
||||
}:
|
||||
let
|
||||
version = "1.6.1";
|
||||
src = fetchFromGitHub {
|
||||
owner = "mistricky";
|
||||
repo = "codesnap.nvim";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-OmSgrTYDtNb2plMyzjVvxGrfXB/lGKDpUQhpRqKfAMA=";
|
||||
};
|
||||
codesnap-lib = rustPlatform.buildRustPackage {
|
||||
pname = "codesnap-lib";
|
||||
inherit version src;
|
||||
|
||||
sourceRoot = "${src.name}/generator";
|
||||
|
||||
cargoHash = "sha256-6n37n8oHIHrz3S1+40nuD0Ud3l0iNgXig1ZwrgsnYTI=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
rustPlatform.bindgenHook
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
libuv.dev
|
||||
];
|
||||
};
|
||||
in
|
||||
vimUtils.buildVimPlugin {
|
||||
pname = "codesnap.nvim";
|
||||
inherit version src;
|
||||
|
||||
# - Remove the shipped pre-built binaries
|
||||
# - Copy the resulting binary from the codesnap-lib derivation
|
||||
# Note: the destination should be generator.so, even on darwin
|
||||
# https://github.com/mistricky/codesnap.nvim/blob/main/scripts/build_generator.sh
|
||||
postInstall =
|
||||
let
|
||||
extension = if stdenv.hostPlatform.isDarwin then "dylib" else "so";
|
||||
in
|
||||
''
|
||||
rm -r $out/lua/*.so
|
||||
cp ${codesnap-lib}/lib/libgenerator.${extension} $out/lua/generator.so
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
nvimRequireCheck = "codesnap";
|
||||
|
||||
passthru = {
|
||||
updateScript = nix-update-script {
|
||||
attrPath = "vimPlugins.codesnap-nvim.codesnap-lib";
|
||||
};
|
||||
|
||||
# needed for the update script
|
||||
inherit codesnap-lib;
|
||||
};
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/mistricky/codesnap.nvim/";
|
||||
changelog = "https://github.com/mistricky/codesnap.nvim/releases/tag/${src.tag}";
|
||||
license = lib.licenses.mit;
|
||||
};
|
||||
}
|
||||
@@ -2465,18 +2465,6 @@ final: prev:
|
||||
meta.homepage = "https://github.com/Exafunction/codeium.vim/";
|
||||
};
|
||||
|
||||
codesnap-nvim = buildVimPlugin {
|
||||
pname = "codesnap.nvim";
|
||||
version = "2024-09-22";
|
||||
src = fetchFromGitHub {
|
||||
owner = "mistricky";
|
||||
repo = "codesnap.nvim";
|
||||
rev = "6400480aa6cc366cbd931146c429aaa64680dab9";
|
||||
sha256 = "1kdqh5vn837pxygz141n01zw08apcxi39xzdn5a0zhddimqn16z1";
|
||||
};
|
||||
meta.homepage = "https://github.com/mistricky/codesnap.nvim/";
|
||||
};
|
||||
|
||||
codewindow-nvim = buildVimPlugin {
|
||||
pname = "codewindow.nvim";
|
||||
version = "2024-06-05";
|
||||
|
||||
@@ -72,9 +72,6 @@
|
||||
zsh,
|
||||
# codeium-nvim dependencies
|
||||
codeium,
|
||||
# codesnap-nvim dependencies
|
||||
clang,
|
||||
libuv,
|
||||
# command-t dependencies
|
||||
getconf,
|
||||
ruby,
|
||||
@@ -678,62 +675,7 @@ in
|
||||
nvimRequireCheck = "codeium";
|
||||
};
|
||||
|
||||
codesnap-nvim =
|
||||
let
|
||||
version = "1.6.1";
|
||||
src = fetchFromGitHub {
|
||||
owner = "mistricky";
|
||||
repo = "codesnap.nvim";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-OmSgrTYDtNb2plMyzjVvxGrfXB/lGKDpUQhpRqKfAMA=";
|
||||
};
|
||||
codesnap-lib = rustPlatform.buildRustPackage {
|
||||
pname = "codesnap-lib";
|
||||
inherit version src;
|
||||
|
||||
sourceRoot = "${src.name}/generator";
|
||||
|
||||
cargoHash = "sha256-6n37n8oHIHrz3S1+40nuD0Ud3l0iNgXig1ZwrgsnYTI=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
rustPlatform.bindgenHook
|
||||
];
|
||||
|
||||
buildInputs =
|
||||
[
|
||||
libuv.dev
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
darwin.apple_sdk.frameworks.AppKit
|
||||
];
|
||||
};
|
||||
in
|
||||
buildVimPlugin {
|
||||
pname = "codesnap.nvim";
|
||||
inherit version src;
|
||||
|
||||
# - Remove the shipped pre-built binaries
|
||||
# - Copy the resulting binary from the codesnap-lib derivation
|
||||
# Note: the destination should be generator.so, even on darwin
|
||||
# https://github.com/mistricky/codesnap.nvim/blob/main/scripts/build_generator.sh
|
||||
postInstall =
|
||||
let
|
||||
extension = if stdenv.hostPlatform.isDarwin then "dylib" else "so";
|
||||
in
|
||||
''
|
||||
rm -r $out/lua/*.so
|
||||
cp ${codesnap-lib}/lib/libgenerator.${extension} $out/lua/generator.so
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
nvimRequireCheck = "codesnap";
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/mistricky/codesnap.nvim/";
|
||||
changelog = "https://github.com/mistricky/codesnap.nvim/releases/tag/v${version}";
|
||||
};
|
||||
};
|
||||
codesnap-nvim = callPackage ./codesnap-nvim { };
|
||||
|
||||
codewindow-nvim = super.codewindow-nvim.overrideAttrs {
|
||||
dependencies = [ self.nvim-treesitter ];
|
||||
|
||||
@@ -203,7 +203,6 @@ https://github.com/manicmaniac/coconut.vim/,HEAD,
|
||||
https://github.com/olimorris/codecompanion.nvim/,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/,,
|
||||
|
||||
Reference in New Issue
Block a user