nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitHub,
4 nix-update-script,
5 rustPlatform,
6 vimPlugins,
7 vimUtils,
8}:
9let
10 version = "0-unstable-2025-05-13";
11 src = fetchFromGitHub {
12 owner = "nvim-pack";
13 repo = "nvim-spectre";
14 rev = "72f56f7585903cd7bf92c665351aa585e150af0f";
15 hash = "sha256-WPEizIClDmseDEhomCasLx/zfAMT7lq7ZBnfc/a8CuA=";
16 };
17
18 spectre_oxi = rustPlatform.buildRustPackage {
19 pname = "spectre_oxi";
20 inherit version src;
21 sourceRoot = "${src.name}/spectre_oxi";
22
23 cargoHash = "sha256-0szVL45QRo3AuBMf+WQ0QF0CS1B9HWPxfF6l6TJtv6Q=";
24
25 preCheck = ''
26 mkdir tests/tmp/
27 '';
28
29 checkFlags = [
30 # Flaky test (https://github.com/nvim-pack/nvim-spectre/issues/244)
31 "--skip=tests::test_replace_simple"
32 ];
33 };
34in
35vimUtils.buildVimPlugin {
36 pname = "nvim-spectre";
37 inherit version src;
38
39 dependencies = [ vimPlugins.plenary-nvim ];
40
41 postInstall = ''
42 ln -s ${spectre_oxi}/lib/libspectre_oxi.* $out/lua/spectre_oxi.so
43 '';
44
45 passthru = {
46 updateScript = nix-update-script {
47 extraArgs = [ "--version=branch" ];
48 attrPath = "vimPlugins.nvim-spectre.spectre_oxi";
49 };
50
51 # needed for the update script
52 inherit spectre_oxi;
53 };
54
55 meta = {
56 homepage = "https://github.com/nvim-pack/nvim-spectre/";
57 license = lib.licenses.mit;
58 };
59}