{ config, pkgs, lib, ... }: let shellAliases = { e = "emacsclient -t"; # Terminal ew = "emacsclient -c"; # New window (and wait) en = "emacsclient -nc"; # New window (and return immediately) calc = "emacs -f full-calc -nw -q"; # Quick fullscreen calculator doom = "~/.emacs.d/bin/doom"; }; in { programs.emacs = { enable = true; package = pkgs.emacsNativeComp; }; home.packages = with pkgs; let py = python3Packages; in [ editorconfig-core-c cask mypy pyright haskell-language-server rust-analyzer texlab (pkgs.makeDesktopItem { name = "org-protocol"; desktopName = "Emacs org-protocol handler"; exec = "emacsclient %u"; terminal = false; categories = [ "System" ]; mimeTypes = [ "x-scheme-handler/org-protocol" ]; }) ]; home.file = { ".doom.d" = { source = ./doom.d; recursive = true; }; ".doom.d/snippets".source = ./snippets; ".doom.d/nix.el".text = '' (add-to-list 'load-path "${pkgs.mu}/share/emacs/site-lisp/mu4e") ''; }; programs.firefox.profiles.default.settings = { "network.protocol-handler.expose.org-protocol" = false; }; programs.zsh = { inherit shellAliases; }; programs.xonsh = { inherit shellAliases; }; services.gpg-agent.extraConfig = '' allow-emacs-pinentry ''; }