{
  pkgs,
  lib,
  ...
}:

{
  environment.systemPackages = with pkgs; [
    direnv
    mu
  ];

  services.emacs = {
    install = true;
    enable = false;
    package =
      with pkgs;
      (
        (emacsPackagesFor (
          emacs-pgtk.overrideAttrs (old: {
            passthru = old.passthru // {
              treeSitter = true;
            };
          })
        )).emacsWithPackages
        (
          epkgs: with epkgs; [
            treesit-grammars.with-all-grammars
            vterm
            pdf-tools
            mu4e
          ]
        )
      );
    defaultEditor = lib.mkDefault true;
  };
}