1 { inputs, pkgs, lib, config, ... }:
4 programs.doom-emacs = {
5 enable = lib.mkEnableOption "doom-emacs";
8 config = lib.mkIf config.programs.doom-emacs.enable {
11 inputs.nix-doom-emacs.hmModule
13 programs.doom-emacs = {
14 enable = config.host.developer;
16 "${config.home.homeDirectory}/.doom.d";
19 #enable = true; # Use with emacsclient -c
20 package = config.programs.emacs.package;
23 home.packages = with pkgs; [
24 # DOOM Emacs dependencies
26 (ripgrep.override { withPCRE2 = true; })
31 #nodePackages.javascript-typescript-langserver
35 emacs-all-the-icons-fonts
37 home.sessionPath = [ "${config.xdg.configHome}/emacs/bin" ];
38 home.sessionVariables = {
39 DOOMDIR = "${config.xdg.configHome}/doom-config";
40 DOOMLOCALDIR = "${config.xdg.configHome}/doom-local";
43 #"doom-config/config.el".source = emacs/config.el;
44 #"doom-config/init.el".source = emacs/init.el;
45 "doom-config/packages.el".text = "";
47 source = inputs.doom-emacs;
48 onChange = "${pkgs.writeShellScript "doom-change" ''
49 export DOOMDIR="${config.home.sessionVariables.DOOMDIR}"
50 export DOOMLOCALDIR="${config.home.sessionVariables.DOOMLOCALDIR}"
51 if [ ! -d "$DOOMLOCALDIR" ]; then
52 ${config.xdg.configHome}/emacs/bin/doom -y install
54 ${config.xdg.configHome}/emacs/bin/doom -y sync -u