flake: move packages to a by-name overlay

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a69642d9409f7d32e01a140cb62c2173b5226
This commit is contained in:
raf 2025-07-20 14:51:46 +03:00
commit 8dd53be910
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
3 changed files with 108 additions and 72 deletions

View file

@ -0,0 +1,70 @@
{
pins,
openssl,
pkg-config,
rustPlatform,
stdenv,
vimUtils,
makeWrapper,
pkgs,
...
}: let
# From npins
pin = pins.avante-nvim;
version = pin.branch;
src = pkgs.fetchFromGitHub {
inherit (pin.repository) owner repo;
rev = pin.revision;
sha256 = pin.hash;
};
avante-nvim-lib = rustPlatform.buildRustPackage {
pname = "avante-nvim-lib";
inherit version src;
cargoHash = "sha256-8mBpzndz34RrmhJYezd4hLrJyhVL4S4IHK3plaue1k8=";
nativeBuildInputs = [
pkg-config
makeWrapper
pkgs.perl
];
buildInputs = [
openssl
];
buildFeatures = ["luajit"];
checkFlags = [
# Disabled because they access the network.
"--skip=test_hf"
"--skip=test_public_url"
"--skip=test_roundtrip"
"--skip=test_fetch_md"
];
};
in
vimUtils.buildVimPlugin {
pname = "avante-nvim";
inherit version src;
doCheck = false;
postInstall = let
ext = stdenv.hostPlatform.extensions.sharedLibrary;
in ''
mkdir -p $out/build
for lib in avante_repo_map avante_templates avante_tokenizers avante_html2md; do
ln -s ${avante-nvim-lib}/lib/lib$lib${ext} $out/build/$$lib${ext}
done
'';
nvimSkipModules = [
# Requires setup with corresponding provider
"avante.providers.azure"
"avante.providers.copilot"
"avante.providers.vertex_claude"
"avante.providers.ollama"
];
}

View file

@ -0,0 +1,40 @@
{
rustPlatform,
fetchFromGitHub,
writeShellScriptBin,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "blink-cmp";
version = "1.3.1";
src = fetchFromGitHub {
owner = "Saghen";
repo = "blink.cmp";
tag = "v${finalAttrs.version}";
hash = "sha256-8lyDDrsh3sY7l0i0TPyhL69Oq0l63+/QPnLaU/mhq5A=";
};
forceShare = [
"man"
"info"
];
postInstall = ''
cp -r {lua,plugin} "$out"
mkdir -p "$out/doc"
cp 'doc/'*'.txt' "$out/doc/"
mkdir -p "$out/target"
mv "$out/lib" "$out/target/release"
'';
cargoHash = "sha256-IDoDugtNWQovfSstbVMkKHLBXKa06lxRWmywu4zyS3M=";
useFetchCargoVendor = true;
nativeBuildInputs = [
(writeShellScriptBin "git" "exit 1")
];
env.RUSTC_BOOTSTRAP = true;
})