2023-06-11 23:09:59 +02:00
|
|
|
# SPDX-FileCopyrightText: 2022 Richard Brežák <richard@brezak.sk>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: LGPL-3.0-or-later
|
2024-03-02 22:05:30 +01:00
|
|
|
{lib, ...}: let
|
|
|
|
inherit
|
|
|
|
(lib)
|
2023-06-11 23:09:59 +02:00
|
|
|
strings
|
2024-03-02 22:05:30 +01:00
|
|
|
flip
|
|
|
|
;
|
|
|
|
in {
|
|
|
|
flake.overlays.tree-sitter-grammars = final: prev: {
|
|
|
|
tree-sitter-grammars =
|
|
|
|
prev.linkFarm "grammars"
|
|
|
|
(flip map (builtins.attrValues prev.tree-sitter.builtGrammars)
|
|
|
|
(
|
|
|
|
drv: let
|
|
|
|
name = strings.getName drv;
|
|
|
|
in {
|
|
|
|
name = "lib${strings.removeSuffix "-grammar" name}.so";
|
|
|
|
path = "${drv}/parser";
|
|
|
|
}
|
|
|
|
));
|
|
|
|
};
|
2023-06-11 23:09:59 +02:00
|
|
|
}
|