From 190a79f37b9955488f025b2374f334c28d9346a4 Mon Sep 17 00:00:00 2001 From: "Gustavo \"Guz\" L de Mello" Date: Wed, 5 Mar 2025 16:02:57 -0300 Subject: [PATCH] feat: use blink.cmp's flake, which provides it's rust fuzzy-finder --- flake.lock | 92 ++++++++++++++++++++++++++++++++++++++ flake.nix | 7 +++ lua/dot013/plugins/ide.lua | 2 +- package.nix | 8 +++- 4 files changed, 106 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 7e89e75..741a318 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,67 @@ { "nodes": { + "blink-cmp": { + "inputs": { + "fenix": "fenix", + "flake-parts": "flake-parts", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1741143396, + "narHash": "sha256-u3Lore4Q7CplMziUEAvUvwDU8zInG/QR6ofxe0C1SAY=", + "owner": "Saghen", + "repo": "blink.cmp", + "rev": "ef9d861952bfe29d096c993d4bd69576e09447fe", + "type": "github" + }, + "original": { + "owner": "Saghen", + "repo": "blink.cmp", + "type": "github" + } + }, + "fenix": { + "inputs": { + "nixpkgs": [ + "blink-cmp", + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1734676450, + "narHash": "sha256-iwcxhTVe4h5TqW0HsNiOQP27eMBmbBshF+q2UjEy5aU=", + "owner": "nix-community", + "repo": "fenix", + "rev": "46e19fa0eb3260b2c3ee5b2cf89e73343c1296ab", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -55,12 +117,42 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1733096140, + "narHash": "sha256-1qRH7uAUsyQI7R1Uwl4T+XvdNv778H0Nb5njNrqvylY=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz" + } + }, "root": { "inputs": { + "blink-cmp": "blink-cmp", "go-grip": "go-grip", "nixpkgs": "nixpkgs" } }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1734622712, + "narHash": "sha256-2Oc2LbFypF1EG3zTVIVcuT5XFJ7R3oAwu2tS8B0qQ0I=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "fe027d79d22f2a7645da4143f5cc0f5f56239b97", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, diff --git a/flake.nix b/flake.nix index 33d20e5..6c50f1d 100644 --- a/flake.nix +++ b/flake.nix @@ -7,6 +7,11 @@ url = "github:guz013/go-grip"; inputs.nixpkgs.follows = "nixpkgs"; }; + + blink-cmp = { + url = "github:Saghen/blink.cmp"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { self, @@ -36,7 +41,9 @@ neovim = import ./package.nix { inherit pkgs lib; go-grip = inputs.go-grip.packages.${pkgs.system}.default; + blink-cmp = inputs.blink-cmp.packages.${pkgs.system}.default; }; + default = self.packages."${pkgs.system}".neovim; }); }; } diff --git a/lua/dot013/plugins/ide.lua b/lua/dot013/plugins/ide.lua index 4ad528c..7d64b5c 100644 --- a/lua/dot013/plugins/ide.lua +++ b/lua/dot013/plugins/ide.lua @@ -97,7 +97,7 @@ return { }, }, -- FRIZBEE is not currently available under nixpkgs. - fuzzy = { implementation = "lua" }, + fuzzy = { implementation = "prefer_rust" }, }) end, }, diff --git a/package.nix b/package.nix index 4317c70..09d1f9c 100644 --- a/package.nix +++ b/package.nix @@ -6,9 +6,13 @@ go-grip ? null, yazi ? pkgs.yazi, ... -}: let +} @ args: let start = with pkgs.vimPlugins; [ - blink-cmp + ( + if args ? blink-cmp + then args.blink-cmp + else blink-cmp + ) catppuccin-nvim indent-blankline-nvim lze