From acb045161f6a1db2d59edf90d764d85ebb028499 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 24 Jan 2026 11:06:44 +0100 Subject: [PATCH] plugins/blink-cmp-nixpkgs-maintainers: init --- .../blink-cmp-nixpkgs-maintainers/default.nix | 47 +++++++++++++++++++ .../blink-cmp-nixpkgs-maintainers/default.nix | 34 ++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 plugins/by-name/blink-cmp-nixpkgs-maintainers/default.nix create mode 100644 tests/test-sources/plugins/by-name/blink-cmp-nixpkgs-maintainers/default.nix diff --git a/plugins/by-name/blink-cmp-nixpkgs-maintainers/default.nix b/plugins/by-name/blink-cmp-nixpkgs-maintainers/default.nix new file mode 100644 index 00000000..5374114b --- /dev/null +++ b/plugins/by-name/blink-cmp-nixpkgs-maintainers/default.nix @@ -0,0 +1,47 @@ +{ lib, ... }: +lib.nixvim.plugins.mkNeovimPlugin { + name = "blink-cmp-nixpkgs-maintainers"; + + maintainers = [ lib.maintainers.GaetanLepage ]; + + description = '' + nixpkgs-maintainers source for blink-cmp. + + --- + + This plugin should be configured through blink-cmp's `sources.providers` settings. + + For example: + + ```nix + plugins.blink-cmp = { + enable = true; + settings.sources = { + per_filetype = { + markdown = [ "nixpkgs_maintainers" ]; + }; + providers = { + nixpkgs_maintainers = { + module = "blink_cmp_nixpkgs_maintainers"; + name = "nixpkgs maintainers"; + opts = { + # Number of days after which the list of maintainers is refreshed + cache_lifetime = 14; + # Do not print status messages + silent = false; + # Customize the `nixpkgs` source flake for fetching the maintainers list + # Example: "github:NixOS/nixpkgs/master" + nixpkgs_flake_uri = "nixpkgs"; + }; + }; + }; + }; + }; + ``` + ''; + + # Configured through blink-cmp + callSetup = false; + hasLuaConfig = false; + hasSettings = false; +} diff --git a/tests/test-sources/plugins/by-name/blink-cmp-nixpkgs-maintainers/default.nix b/tests/test-sources/plugins/by-name/blink-cmp-nixpkgs-maintainers/default.nix new file mode 100644 index 00000000..093d2d28 --- /dev/null +++ b/tests/test-sources/plugins/by-name/blink-cmp-nixpkgs-maintainers/default.nix @@ -0,0 +1,34 @@ +{ + empty = { + plugins = { + blink-cmp.enable = true; + blink-cmp-nixpkgs-maintainers.enable = true; + }; + }; + + example = { + plugins = { + blink-cmp-nixpkgs-maintainers.enable = true; + blink-cmp = { + enable = true; + + settings.sources = { + per_filetype = { + markdown = [ "nixpkgs_maintainers" ]; + }; + providers = { + nixpkgs_maintainers = { + module = "blink_cmp_nixpkgs_maintainers"; + name = "nixpkgs maintainers"; + opts = { + cache_lifetime = 14; + silent = false; + nixpkgs_flake_uri = "nixpkgs"; + }; + }; + }; + }; + }; + }; + }; +}