aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Coudron <teto@users.noreply.github.com>2023-06-11 15:38:30 +0200
committerGitHub <noreply@github.com>2023-06-11 15:38:30 +0200
commitdcb341315a7d8490685036122a3ac2a09499a245 (patch)
tree345a6155d05ceafc4b8ce1ffa3fad161a38f6992
parent72de8fdeebd1cafeb05d3e5b03e537b8cb99178b (diff)
parent8df3381202046ee5feeb9e9256d21f20a20531fb (diff)
downloadrneovim-dcb341315a7d8490685036122a3ac2a09499a245.tar.gz
rneovim-dcb341315a7d8490685036122a3ac2a09499a245.tar.bz2
rneovim-dcb341315a7d8490685036122a3ac2a09499a245.zip
Merge pull request #23968 from figsoda/bundle
build(nix): use the correct versions of the bundled treesitter parsers
-rw-r--r--contrib/flake.lock30
-rw-r--r--contrib/flake.nix41
2 files changed, 63 insertions, 8 deletions
diff --git a/contrib/flake.lock b/contrib/flake.lock
index 1144165ed1..554dc22bdb 100644
--- a/contrib/flake.lock
+++ b/contrib/flake.lock
@@ -1,12 +1,15 @@
{
"nodes": {
"flake-utils": {
+ "inputs": {
+ "systems": "systems"
+ },
"locked": {
- "lastModified": 1667395993,
- "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
+ "lastModified": 1685518550,
+ "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide",
"repo": "flake-utils",
- "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
+ "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github"
},
"original": {
@@ -17,11 +20,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1681465517,
- "narHash": "sha256-EasJh15/jcJNAHtq2SGbiADRXteURAnQbj1NqBoKkzU=",
+ "lastModified": 1686226982,
+ "narHash": "sha256-nLuiPoeiVfqqzeq9rmXxpybh77VS37dsY/k8N2LoxVg=",
"owner": "nixos",
"repo": "nixpkgs",
- "rev": "abe7316dd51a313ce528972b104f4f04f56eefc4",
+ "rev": "a64b73e07d4aa65cfcbda29ecf78eaf9e72e44bd",
"type": "github"
},
"original": {
@@ -36,6 +39,21 @@
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
}
},
"root": "root",
diff --git a/contrib/flake.nix b/contrib/flake.nix
index 59d977b748..e4d0fae99f 100644
--- a/contrib/flake.nix
+++ b/contrib/flake.nix
@@ -7,13 +7,50 @@
};
outputs = { self, nixpkgs, flake-utils }:
+ let
+ inherit (builtins)
+ elemAt
+ foldl'
+ mapAttrs
+ match
+ readFile
+ ;
+ inherit (nixpkgs.lib)
+ const
+ flip
+ pipe
+ remove
+ splitString
+ toLower
+ ;
+ in
{
overlay = final: prev: {
- neovim = final.neovim-unwrapped.overrideAttrs (oa: rec {
+ neovim = (final.neovim-unwrapped.override {
+ treesitter-parsers = pipe ../cmake.deps/deps.txt [
+ readFile
+ (splitString "\n")
+ (map (match "TREESITTER_([A-Z_]+)_(URL|SHA256)[[:space:]]+([^[:space:]]+)[[:space:]]*"))
+ (remove null)
+ (flip foldl' { }
+ (acc: matches:
+ let
+ lang = toLower (elemAt matches 0);
+ type = toLower (elemAt matches 1);
+ value = elemAt matches 2;
+ in
+ acc // {
+ ${lang} = acc.${lang} or { } // {
+ ${type} = value;
+ };
+ }))
+ (mapAttrs (const final.fetchurl))
+ ];
+ }).overrideAttrs (oa: rec {
version = self.shortRev or "dirty";
src = ../.;
- preConfigure = ''
+ preConfigure = oa.preConfigure or "" + ''
sed -i cmake.config/versiondef.h.in -e 's/@NVIM_VERSION_PRERELEASE@/-dev-${version}/'
'';
nativeBuildInputs = oa.nativeBuildInputs ++ [