Installation
Jotain uses Nix to build Emacs from source, driven by aJustfile task runner. Development assumes a devenv shell (managed by direnv via .envrc, or entered manually with devenv shell).
Prerequisites
- Nix package manager with
nix-buildavailable - just task runner (provided by the devenv shell)
- devenv (optional but recommended for development)
just recipes assume the devenv shell is active. If you do not use direnv, prefix any command with devenv shell --, e.g. devenv shell -- just check.
Building Emacs
The default build targets the current system and includes every tree-sitter grammar from nixpkgs:nix-build --argstr system <current-system> default.nix, which wraps emacs.nix with emacsPackagesFor ... withPackages to add treesit-grammars.with-all-grammars. For the plain mainline build (the emacs.nix default), the store path is bit-for-bit identical to nixpkgs’ default pkgs.emacs, so the official binary cache is hit and nothing recompiles from source; the git-based variants are likewise cache hits from nix-community/emacs-overlay’s nix-community.cachix.org.
Build Variants
Everyemacs.nix argument is forwarded through default.nix. The Justfile provides shortcuts for the common flavours:
nix-build directly with any argument the emacs.nix file accepts:
git/unstable/igc build the revision pinned by emacs-overlay and are binary-cache hits. Only when pinning a custom commit via --argstr rev "..." does the first build fail and report the expected hash to pass back via --argstr hash "sha256-...".Installing from a Consumer Flake
Jotain exposes Home Manager, NixOS, and nix-darwin modules. The default backend stays on the cache-friendlyemacs.nix build:
github:jylhis/emacs Meson fork, select the fork backend:
jylhis-emacs input:
packages output, because the Meson fork still crashes while byte-compiling some bundled Emacs packages. It remains reachable via the Home Manager services.jotain.emacsBackend = "jylhis" option (which consumes the jylhisEmacsPackages overlay attribute directly) for those who want to exercise that experimental path.
nix-on-droid (Android)
Jotain also ships a nix-on-droid module for running Emacs on Android (Termux/proot). Android is headless under proot, so the module installs a terminal-only (-nw) Emacs into environment.packages and wires EDITOR/VISUAL to an emacsclient wrapper — there is no systemd daemon, launchd agent, or GUI frame.
nix-on-droid switch --flake .#default. See nixOnDroidConfigurations.default in Jotain’s flake.nix for a complete example wiring.
Like the NixOS / nix-darwin module (
module-system.nix), this module installs the curated Jotain Emacs package — Jotain’s Emacs packages, tree-sitter grammars, themes, and Info manual are on the load-path — but it does not install Jotain’s own early-init.el / init.el / lisp/. To have Emacs boot the full Jotain configuration, point it at the config with --init-directory (the way just run does) or layer the Home Manager module through nix-on-droid’s home-manager.config, which installs the config into a writable ~/.config/emacs. A bare --init-directory into the read-only Nix store will not work, because Jotain writes var/, elpa/, and eln-cache/ under user-emacs-directory.Overriding nixpkgs
Downstream flakes may pin a different nixpkgs (release branches 24.05+ through unstable) by following the input:emacs.nix gates the Emacs build flags that newer make-emacs.nix versions introduced, so the modules still evaluate and build on older releases. Note that on 24.05 pkgs.emacs is Emacs 29 while Jotain’s Elisp targets Emacs 30/31 — the build succeeds, but full runtime behaviour is only guaranteed on the pinned unstable.
Running
Jotain is designed to be launched out of its own checkout via--init-directory, so it never touches ~/.emacs.d.
just run simply invokes emacs --init-directory=<repo>. The devenv shell ships the same Emacs that just build-bare produces, so running inside direnv is usually enough for day-to-day use — no nix-build required.