Architecture Overview
Jotain is organised into distinct layers, each with a clear responsibility.File Structure
Layers
Emacs Lisp Layer
The Elisp configuration is split into three parts:-
early-init.el— loaded beforepackage.el, before the first frame, beforeinit.el. Handles anything that must happen that early: the startup GC threshold,use-package-always-ensure, frame chrome defaults, native-comp and eln-cache redirection, terminal aliases. -
init.el— tiny entry point. Registers MELPA/NonGNU ELPA as fallback archives, putslisp/on the load-path, pointscustom-fileatvar/custom.el(write-only — never loaded back), andrequires each module in order. A bootstrap guard handles the first run afterjust clean-all. -
lisp/init-*.el— one file per concern. See Modules for the full list and their responsibilities.
Nix Layer
The Nix layer provides reproducible Emacs builds:-
emacs.nix— wrapspkgs.emacs30(orpkgs.emacs30-macport) with the full set of build flags exposed as arguments. A cache-parity invariant guarantees thatimport ./emacs.nix {}produces the same store path aspkgs.emacs30, so the default build is a cache hit. Divergent variants (git,unstable,igc,macport, Darwin patches) run throughoverrideAttrsand intentionally rebuild from source. -
default.nix— distribution wrapper. Importsemacs.nix, forwards every argument, and (by default) callsemacsPackagesFor emacs |> withPackages (ep: [ ep.treesit-grammars.with-all-grammars ])to produce an Emacs that ships every tree-sitter grammar in nixpkgs. -
nix/jotain-service.nix— Home Manager module that runs Jotain as a user-session Emacs daemon (services.jotain), generates a desktop entry foremacsclient, and can install itself asEDITOR/VISUAL. Supports systemd on Linux and launchd on macOS.
Development Layer
devenv.nix— development shell. Provides the local Emacs build (soemacsin the shell matchesjust build-bare), Nerd Fonts,npins,nil,nixfmt-rfc-style, andtreefmt. Enables the customlanguages.emacs-lispmodule fromnix/devenv-emacs-lisp.nix, which provides Emacs +eask-cli(withellspandelsaoff by default).Justfile— every recipe you run day-to-day:run,debug,tty,check,compile,test, thebuild-*matrix,fmt,update-pins,clean,clean-all.npins/— pinned sources (at minimumnixpkgs-unstable). Updated withjust update-pins.