emacs.nix 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. { config, pkgs, ... }:
  2. let
  3. disabled = import ./disabledapp.nix;
  4. emacs = pkgs.emacs29-pgtk.override {
  5. withNativeCompilation = true;
  6. withTreeSitter = true;
  7. };
  8. in {
  9. home.file = {
  10. ".emacs.d/early-init.el".source = ./emacs/early-init.el;
  11. ".emacs.d/init.el".source = ./emacs/init.el;
  12. };
  13. programs.emacs = {
  14. enable = true;
  15. extraPackages = epkgs: with epkgs; [
  16. almost-mono-themes
  17. circadian
  18. consult
  19. corfu
  20. envrc
  21. evil
  22. evil-collection
  23. evil-easymotion
  24. haskell-mode
  25. jinx
  26. magit
  27. marginalia
  28. markdown-mode
  29. meson-mode
  30. minions
  31. nix-mode
  32. treesit-grammars.with-all-grammars
  33. undo-tree
  34. use-package
  35. vertico
  36. yasnippet
  37. zig-mode
  38. ];
  39. package = emacs;
  40. };
  41. services.emacs = {
  42. enable = true;
  43. client = {
  44. enable = false;
  45. arguments = [
  46. "--reuse-frame"
  47. "--no-wait"
  48. "--quiet"
  49. "--suppress-output"
  50. ];
  51. };
  52. defaultEditor = true;
  53. package = config.programs.emacs.finalPackage;
  54. startWithUserSession = "graphical";
  55. };
  56. xdg.desktopEntries = {
  57. emacs = {
  58. categories = [ "Development" "TextEditor" ];
  59. comment = "Edit text";
  60. exec = "emacsclient --reuse-frame --no-wait --quiet --suppress-output --alternate-editor=emacs %F";
  61. genericName = "Text Editor";
  62. icon = "emacs";
  63. mimeType = [
  64. "application/x-shellscript"
  65. "text/english"
  66. "text/plain"
  67. "text/x-c"
  68. "text/x-c++"
  69. "text/x-c++hdr"
  70. "text/x-c++src"
  71. "text/x-chdr"
  72. "text/x-csrc"
  73. "text/x-java"
  74. "text/x-makefile"
  75. "text/x-moc"
  76. "text/x-pascal"
  77. "text/x-tcl"
  78. "text/x-tex"
  79. ];
  80. name = "Emacs";
  81. startupNotify = false;
  82. terminal = false;
  83. type = "Application";
  84. };
  85. emacs-mail = disabled;
  86. emacsclient = disabled;
  87. emacsclient-mail = disabled;
  88. };
  89. }