Skip to content

Commit

Permalink
init: use tree-sitter modes (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
terlar authored Aug 3, 2023
1 parent fc23e56 commit c622089
Show file tree
Hide file tree
Showing 2 changed files with 130 additions and 112 deletions.
25 changes: 24 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,30 @@
stdenv,
trivialBuild,
emacs-all-the-icons-fonts,
linkFarm,
ripgrep,
tree-sitter-grammars,
writeText,
xorg,
}: let
initTreesit = writeText "init-treesit.el" ''
(add-to-list 'treesit-extra-load-path "${
lib.pipe tree-sitter-grammars [
builtins.attrValues
(builtins.filter lib.isDerivation)
(map (drv: {
name = builtins.concatStringsSep "" [
"lib"
(lib.removeSuffix "-grammar" (lib.getName drv))
stdenv.targetPlatform.extensions.sharedLibrary
];
path = "${drv}/parser";
}))
(linkFarm "treesit-grammars")
]
}/")
'';

init = trivialBuild {
pname = "config-init";

Expand All @@ -16,6 +37,8 @@
--load org \
*.org \
--funcall org-babel-tangle
cat ${initTreesit} >> init.el
'';

buildPhase = ''
Expand Down Expand Up @@ -47,7 +70,7 @@ in
];

passthru.components = {
inherit init;
inherit init initTreesit;
};

installPhase = ''
Expand Down
Loading

0 comments on commit c622089

Please sign in to comment.