{ config, lib, pkgs, ... }:

let cfg = config.sydnix.users.msyds.emacs.treesit;
in {
  options.sydnix.users.msyds.emacs.treesit = {
    enable = lib.mkEnableOption "Treesitter grammars";
  };

  config = lib.mkIf cfg.enable {
    sydnix.emacs.emacsPackages = epkgs: [
      epkgs.treesit-grammars.with-all-grammars
    ];
  };
}
