Components

What emanix actually installs, by tier. Most of it is Home Manager; the substrate and the compositor are NixOS.

1. Home Manager tier (home/)

1.1. Emacs

The centre of the system. Emacs 31.1 on a per-host base: EWM hosts run EWM's pwayl/Skia (GPU) fork, built through emacs-overlay; other hosts run pgtk. One package list, one base per host, with a curated package set and modal editing.

There is exactly one Emacs build on a host. Which one you get depends on emanix.ewm.enable:

  • true — the system-owned build, carrying the compositor's own package, put on the system PATH so emacsclient is available everywhere. Home Manager delivers configuration only, never a second Emacs.
  • false — the same package set minus the compositor, installed at the home level and run as a systemd user service.

Two builds of Emacs on one machine is a failure.

The per-host base. The EWM compositor is a client of the pwayl/Skia fork, so an EWM host cannot run an ordinary pgtk Emacs. That fork is built once, in one place, and used by both the NixOS tier that runs the compositor and the Home Manager tier that builds the package set — a second copy would give a machine two Emacsen. The fork borrows its build recipe from emacs-overlay's 31.1 because the stable channel ships 30.2 and has no Emacs 31 attribute. Whichever module owns a host's Emacs records the choice in emanix.emacs.base, which consumers read when they have to build an Emacs package against the same base (see Options). The reasoning is in docs/decisions/gpu-emacs.md.

1.2. EWM — the compositor

A Wayland compositor written in Rust on Smithay, loaded as a dynamic module inside the Emacs process. Windows, workspaces and the status bar are Emacs, so keybindings and configuration are one language. Upstream is codeberg.org/ezemtsov/ewm.

It launches from the TTY login shell, inside the logind session scope. The shipped systemd user unit runs outside any session and cannot acquire display-master without a display manager, so the login shell is the launch path.

Three details in that launch:

  • One compositor per boot session. A stale daemon holds display-master and starves every new launch, so the launcher kills a prior instance first — and matches on the full command line, because the Nix wrapper truncates the process name.
  • A flap guard. If the compositor crashes in a loop, a marker file drops you to a normal shell instead of an unusable login cycle. Remove it to re-arm.
  • Keyboard options are set in the environment, not in the compositor's own config, because the keymap is built at compositor start — configuration applied afterwards is too late.

1.3. Terminal and shell

A GPU-accelerated terminal, gated on emanix.ghostty.enable, and zsh with completion and a themed prompt. There is no multiplexer; remote sessions are the consumer's concern.

1.4. The coding agent is not shipped

Emanix ships the wiring — the emanix-agent-shell.el ACP glue (C-c C-' for Claude, C-c p for pi), the adapter wrappers in agent-acp/, and a secret store your flake can point at a credential. Supply the claude or pi CLI and the keys work; supply none and the binding reports the missing adapter rather than failing silently. See Secrets.

1.5. Everything else

Search and file tooling, git and its helpers, a formatter and linters for Nix itself, Python tooling, media tooling, screenshot and screen-recording utilities for Wayland, a password manager, and fonts.

Feature flags decide which of it materializes: a host with emanix.gui = false does not receive the GUI applications, because the modules that provide them are gated on that flag. Nothing consults the role.

Two seams let a consumer extend the tier: emanix.emacs.extraPackages adds Emacs packages to the distribution's build, and emanix/modeline-extra-segments registers extra tab-bar segments as no-argument functions. The distribution ships none of either.

2. NixOS tier (modules/)

Six modules. Three are the substrate.

2.1. Base — every host

Shell, primary user, timezone, locale, console keymap, and the Nix settings:

  • Flakes and the modern CLI enabled
  • Store auto-optimisation
  • Daily garbage collection
  • A mid-build emergency valve: when free space drops below a floor, Nix collects garbage during the build until a ceiling is available again

A weekly timer is not enough on a host that builds often: a churning machine can accumulate many gigabytes of dead paths within a day or two of a successful collection. And on a virtualised host whose disk image never shrinks below its high-water mark, garbage that lives a week costs real disk on the host side even after it is finally collected.

2.2. init

The first system generation, and emanix-init on the PATH: the tool that adopts a generated configuration into a git repository, and fails the build rather than failing on a stranger's console.

2.3. Firstboot

Packages the one-time post-install command. It is built with a wrapper that shellchecks the script at build time, so a broken helper fails the build rather than the install.

2.4. The rest of the tier

gpu.nix and firmware.nix supply hardware capability, and ewm.nix is the compositor service, exposed as nixosModules.ewm.

Every host gets the secret store: mkHost imports the agenix module, so a consumer supplies recipients and secrets rather than wiring the mechanism.

3. Hardware and network

Capability, not facts. The distribution ships emanix.hardware.gpu, the redistributable-firmware default, and lib.mkDisk for describing a disk's shape — how to bring up a GPU or lay out a disk, not which GPU a box has or which disk it is.

Which drivers must be in the initrd, how the disks are partitioned, what mesh or network the host joins — those are facts about a particular machine on a particular network, and only your flake knows them. See Architecture for the argument.