Skip to content

Conversation

@blackxored
Copy link

@blackxored blackxored commented Nov 27, 2025

blink-cmp is broken because of some rust flags that need to be passed in (See NixOS/nixpkgs#464350). Had to fork so it would be nice if you could override the package as in this PR.

@github-actions
Copy link

🚀 Live preview deployed from 0947052

View it here:

Debug Information

Triggered by: blackxored

HEAD at: fix/blink-cmp-package-option

Reruns: 1623

@NotAShelf
Copy link
Owner

NotAShelf commented Nov 27, 2025

Okay, I'm ammendable to such a change but there are two crucial points to consider.

  1. We try to avoid relying on Nixpkgs for plugins. They are maintained haphazardly at best, and I do not wish to deal with upstream. Currently blink is managed by flake packages locally, and finding a way to override that one would be better.

  2. If we are adding one package option, then we need to support the package option for other plugin modules as well. This has been something I've been considering, but since most plugins are just fetch + unpack + install, overriding the pin (as documented) is preferable.

An option that addresses both of those points might be to allow overriding built packages instead of just npins sources. This way you could change what the package corresponds to and thus use any packaged plugin.

@blackxored
Copy link
Author

Good points all-round, I just need a way to override if there's such a broken state I cannot rebuild until this project gets updated (the missing Rust flags being one example), and also blink-cmp has been on 1.6.0 for a while so it was Nix that broke it.

@alfarelcynthesis
Copy link
Contributor

pluginOverrides works for some things, idk if it would for blink.

@alapshin
Copy link

I was able to override blink-cmp package without using package from nixpkgs using approach like this

{
  lib,
  pkgs,
  inputs,
  ...
}:
let
  inherit (lib.generators) mkLuaInline;
  system = pkgs.stdenv.hostPlatform.system;
  packages = inputs.nvf.packages."${system}";
in
{
  home.sessionVariables.EDITOR = "nvim";
  programs.nvf = {
    enable = true;
    settings.vim = {
      viAlias = true;
      vimAlias = true;
      enableLuaLoader = true;

      pluginOverrides = {
        blink-cmp = packages.blink-cmp.overrideAttrs (oldAttrs: {
          env = oldAttrs.env // {
            RUSTFLAGS = lib.optionalString pkgs.stdenv.hostPlatform.isDarwin "-C link-arg=-undefined -C link-arg=dynamic_lookup";
          };
        });
      };
    };
  };
}

One have to pass nvf input and copy-paste RUSTFLAGS from nixpkgs PR. Guess a proper way to fix it would be update package definition for blink-cmp https://github.com/NotAShelf/nvf/blob/v0.8/flake/pkgs/by-name/blink-cmp/package.nix and add missing RUSTFLAGS.

@blackxored
Copy link
Author

I was able to override blink-cmp package without using package from nixpkgs using approach like this

{
  lib,
  pkgs,
  inputs,
  ...
}:
let
  inherit (lib.generators) mkLuaInline;
  system = pkgs.stdenv.hostPlatform.system;
  packages = inputs.nvf.packages."${system}";
in
{
  home.sessionVariables.EDITOR = "nvim";
  programs.nvf = {
    enable = true;
    settings.vim = {
      viAlias = true;
      vimAlias = true;
      enableLuaLoader = true;

      pluginOverrides = {
        blink-cmp = packages.blink-cmp.overrideAttrs (oldAttrs: {
          env = oldAttrs.env // {
            RUSTFLAGS = lib.optionalString pkgs.stdenv.hostPlatform.isDarwin "-C link-arg=-undefined -C link-arg=dynamic_lookup";
          };
        });
      };
    };
  };
}

One have to pass nvf input and copy-paste RUSTFLAGS from nixpkgs PR. Guess a proper way to fix it would be update package definition for blink-cmp https://github.com/NotAShelf/nvf/blob/v0.8/flake/pkgs/by-name/blink-cmp/package.nix and add missing RUSTFLAGS.

I'll try that in a bit, thanks! Aren't you resetting RUSTFLAGS on non-darwin though? Should probably move up the chain with lib.optionalAttrs.

@NotAShelf
Copy link
Owner

The breakage should've been fixed on latest v0.8 commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants