nichts/modules/programs/editors/emacs.nix

64 lines
1.5 KiB
Nix
Raw Normal View History

2024-05-22 14:29:45 +02:00
{
config,
lib,
pkgs,
inputs,
...
2024-07-18 18:07:07 +02:00
}: let
2024-07-20 13:18:01 +02:00
cfg = config.modules.system.programs.editors.emacs;
2024-07-16 11:13:12 +02:00
inherit (config.modules.other.system) username;
2024-07-20 13:18:01 +02:00
inherit (lib) mkIf;
2024-08-20 16:43:24 +02:00
# Taken from outfoxxed since figuring this out is really annoying.
2024-09-02 22:26:18 +02:00
emacsOverlay =
2024-07-18 18:07:07 +02:00
pkgs.appendOverlays
(with inputs.emacs-overlay.overlays; [
emacs
package
]);
2024-09-02 22:26:18 +02:00
customEmacs = with emacsOverlay; ((emacsPackagesFor
2024-08-27 16:53:00 +02:00
(emacs29-pgtk.override {withNativeCompilation = true;}))
.emacsWithPackages (epkgs:
with epkgs; [
vterm
]));
2024-07-18 18:07:07 +02:00
in {
config = mkIf cfg.enable {
2024-08-27 16:58:54 +02:00
environment.variables.PATH = ["$XDG_CONFIG_HOME/emacs/bin"];
2024-07-18 18:07:07 +02:00
home-manager.users.${username} = {
2024-07-20 12:08:25 +02:00
home.packages = with pkgs; [
2024-09-02 22:26:18 +02:00
# needed by native-comp
2024-08-27 16:53:00 +02:00
binutils
# Emacs itself
2024-09-02 22:26:18 +02:00
customEmacs
2024-08-27 16:53:00 +02:00
# Doom dependencies
git
2024-07-20 12:08:25 +02:00
ripgrep
2024-08-27 16:53:00 +02:00
gnutls
## Optional dependencies
fd # faster projectile indexing
imagemagick # for image-dired
# (mkIf (config.programs.gnupg.agent.enable)
# pinentry-emacs) # in-emacs gnupg prompts
zstd # for undo-fu-session/undo-tree compression
2024-08-27 16:58:54 +02:00
# Module dependencies
2024-08-27 16:53:00 +02:00
# :checkers spell
(aspellWithDicts (ds: with ds; [de en en-computers en-science]))
# :tools editorconfig
editorconfig-core-c # per-project style config
# :tools lookup & :lang org +roam
2024-07-20 12:08:25 +02:00
sqlite
];
2024-08-27 16:53:00 +02:00
2024-07-18 18:07:07 +02:00
services.emacs = {
enable = true;
2024-09-02 22:26:18 +02:00
package = customEmacs;
2024-07-18 18:07:07 +02:00
};
};
};
}