My personal Emacs configuration. It’s a chonker.
I don’t recommend anyone else actually uses this as-is since it’s a personal setup that I change regularly. But the overall structure works well, and I’ve had a few coworkers fork and riff on this–it’s less magic than some of the popular community Emacs setups.
It demonstrates how to:
- dynamically load config files from a directory using just use-package
- split your configuration up, to keep config separate from vendored code
- use Nix to build a self-contained Emacs with the 3rd party packages and utilities it needs
Nix is used to build an Emacs along with 3rd-party Lisp packages and required programs.
nix-build
./result/bin/emacs
The derivation can be imported into a NixOS or home-manager configuration using the usual mechanisms. Doing this would allow you to add this Emacs to your Nix profile for normal use.
{ pkgs, ... }:
{
nixpkgs.overlays = [
(self: super:
{
emacsCustom = builtins.fetchTarball rec {
rev = "master";
url = "https://github.com/chrisbarrett/.emacs.d/archive/${rev}.tar.gz";
};
})
];
home.packages = [
# Installs to ~/.nix-profile/bin/{emacs,emacsclient}
pkgs.emacsCustom
];
}