Emacs, exwm, home-manager and loading new [emacs] modules

I was able to get this working with the following home-manager configuration:

{ pkgs, home, config, ... }:
let
  cfg = config.programs.emacs;
in
{
...
  home.file.".emacs.d/load-path.el".source = pkgs.writeText "load-path.el" ''
    (let ((default-directory (file-name-as-directory
                         "${cfg.finalPackage.deps}/share/emacs/site-lisp/"))
          (normal-top-level-add-subdirs-inode-list nil))
    (normal-top-level-add-subdirs-to-load-path))
  '';
...
}

This lets me update my Emacs load-path with M-x load-file ~/.emacs.d/load-path.el after a home-manager switch, no Emacs restarts required :slight_smile:

1 Like