dotfiles/overlays/tree-sitter-grammars.nix
Magic_RB 519d7b3841
Fill out omen, toothpick and heater
Signed-off-by: Magic_RB <magic_rb@redalder.org>
2023-06-16 16:08:01 +02:00

26 lines
636 B
Nix

# SPDX-FileCopyrightText: 2022 Richard Brežák <richard@brezak.sk>
#
# SPDX-License-Identifier: LGPL-3.0-or-later
{ lib, ... }:
let
inherit (lib)
strings
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";
}
));
};
}