From 9eef2b111d7ed1546509b75fd22e618e02dd3a73 Mon Sep 17 00:00:00 2001 From: figsoda Date: Fri, 9 Jun 2023 16:29:38 -0400 Subject: [PATCH 1/2] build(nix): update flake.lock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'flake-utils': 'github:numtide/flake-utils/5aed5285a952e0b949eb3ba02c12fa4fcfef535f' (2022-11-02) → 'github:numtide/flake-utils/a1720a10a6cfe8234c0e93907ffe81be440f4cef' (2023-05-31) • Added input 'flake-utils/systems': 'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e' (2023-04-09) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/abe7316dd51a313ce528972b104f4f04f56eefc4' (2023-04-14) → 'github:nixos/nixpkgs/a64b73e07d4aa65cfcbda29ecf78eaf9e72e44bd' (2023-06-08) --- contrib/flake.lock | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 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", From 8df3381202046ee5feeb9e9256d21f20a20531fb Mon Sep 17 00:00:00 2001 From: figsoda Date: Fri, 9 Jun 2023 16:50:23 -0400 Subject: [PATCH 2/2] build(nix): use the correct versions of the bundled treesitter parsers --- contrib/flake.nix | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) 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 ++ [