robin/ivy

my custom neovim config

git clone https://git.robinwobin.dev/robin/ivy

robinflake: update all inputs3e5ab3a

main
1.7 KiB64 linesraw
1{
2  lib,
3  stdenv,
4  callPackage,
5  neovim-src,
6
7  libuv,
8  gettext,
9
10  neovim-unwrapped,
11  baseNeovimUnwrapped ? neovim-unwrapped,
12  ...
13}:
14let
15  src = neovim-src;
16
17  tree-sitter = callPackage ./tree-sitter-bundled.nix {
18    inherit dependencies;
19  };
20
21  dependencies = callPackage ./dependencies.nix {
22    inherit neovim-src;
23  };
24
25  # The following overrides will only take effect for linux hosts
26  linuxOnlyOverrides = lib.optionalAttrs stdenv.isLinux {
27    gettext = gettext.overrideAttrs {
28      # FIXME: nixpkgs' gettext is now at version 0.22.5 whereas neovim's is pinned at 0.20.5
29      # Overriding the source leads to a build error of gettext.
30      # Neovim seems to build fine with nixpkgs' gettext, so we use that in the meantime.
31      # src = dependencies.gettext;
32    };
33  };
34
35  overrides = {
36    libuv = libuv.overrideAttrs {
37      # FIXME: overriding libuv casues high CPU usage on darwin
38      # https://github.com/nix-community/neovim-nightly-overlay/issues/538
39      # src = dependencies.libuv;
40    };
41    inherit tree-sitter;
42
43    treesitter-parsers =
44      let
45        grammars = lib.filterAttrs (
46          name: _: lib.hasPrefix "treesitter_" name && !lib.hasSuffix "_wasm" name
47        ) dependencies;
48      in
49      lib.mapAttrs' (
50        name: value: lib.nameValuePair (lib.removePrefix "treesitter_" name) { src = value; }
51      ) grammars;
52  }
53  // linuxOnlyOverrides;
54in
55(baseNeovimUnwrapped.override overrides).overrideAttrs (oa: {
56  version = "${neovim-src.shortRev or "dirty"}";
57  inherit src;
58
59  preConfigure = ''
60    ${oa.preConfigure}
61    substituteInPlace cmake.config/versiondef.h.in \
62      --replace-fail '@NVIM_VERSION_PRERELEASE@' '-nightly+${neovim-src.shortRev or "dirty"}'
63  '';
64})