anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / applications / editors / emacs / elisp-packages / manual-packages / treesit-grammars / package.nix
blobaf720337ff05e71385482270e0c77777f76f3f55
1 { pkgs, lib }:
3 let
4   libExt = pkgs.stdenv.hostPlatform.extensions.sharedLibrary;
5   grammarToAttrSet = drv:
6     {
7       name = "lib/lib${lib.strings.removeSuffix "-grammar" (lib.strings.getName drv)}${libExt}";
8       path = "${drv}/parser";
9     };
11   # Usage:
12   # treesit-grammars.with-grammars (p: [ p.tree-sitter-bash p.tree-sitter-c ... ])
13   with-grammars = fn: pkgs.linkFarm "emacs-treesit-grammars"
14     (map grammarToAttrSet (fn pkgs.tree-sitter.builtGrammars));
17   inherit with-grammars;
19   with-all-grammars = with-grammars builtins.attrValues;