feat(emacs): Add prebuilt Doom option using nix-doom-emacs-unstraightened #6

Merged
johno merged 1 commits from feat/prebuilt-doom-usb-nixos-configs-1wd into main 2026-01-10 12:33:44 -08:00
Owner

Summary

Implements pre-built Doom Emacs packages for the live USB image, eliminating the need to run doom sync after first boot.

Problem

When booting into a live USB with Doom Emacs, the user must:

  1. Have internet access
  2. Run doom sync (which takes several minutes)
  3. Wait for packages to download and compile

This is time-consuming and requires connectivity, making it impractical for offline use or quick system recovery.

Solution

Integrate nix-doom-emacs-unstraightened which:

  • Bypasses straight.el entirely
  • Uses Nix's emacsWithPackages to install packages from nixpkgs/emacs-overlay
  • Compiles all Doom packages at nix build time

Changes

New flake input

  • nix-doom-emacs-unstraightened added with empty nixpkgs follows (uses its own emacs-overlay)

Updated home/roles/emacs/default.nix

  • Added prebuiltDoom option (default: false)
  • Standard mode: Original behavior, requires doom sync
  • Prebuilt mode: Uses programs.doom-emacs from nix-doom-emacs-unstraightened

Updated home/roles/emacs/doom/packages.el

  • Pinned custom packages for deterministic builds:
    • claude-code-ide760240d7f03ff16f90ede9d4f4243cd94f3fed73
    • gptel-tool-librarybaffc3b0d74a2b7cbda0d5cd6dd7726d6ccaca83
    • beadsf40a6461d3c0fa0969311bbb6a1e30d1bba86c88

Updated home/home-live-usb.nix

  • Enabled emacs.prebuiltDoom = true

Usage

For live USB (already enabled):

emacs = {
  enable = true;
  prebuiltDoom = true;
};

For regular systems (unchanged default):

emacs.enable = true;  # Still uses traditional doom sync

Trade-offs

  • Pro: No doom sync needed, works offline, reproducible
  • Con: Doom config is read-only (stored in nix store)
  • Con: Build time increases due to package compilation

Bead: nixos-configs-1wd

## Summary Implements pre-built Doom Emacs packages for the live USB image, eliminating the need to run `doom sync` after first boot. ## Problem When booting into a live USB with Doom Emacs, the user must: 1. Have internet access 2. Run `doom sync` (which takes several minutes) 3. Wait for packages to download and compile This is time-consuming and requires connectivity, making it impractical for offline use or quick system recovery. ## Solution Integrate [nix-doom-emacs-unstraightened](https://github.com/marienz/nix-doom-emacs-unstraightened) which: - Bypasses `straight.el` entirely - Uses Nix's `emacsWithPackages` to install packages from nixpkgs/emacs-overlay - Compiles all Doom packages at `nix build` time ## Changes ### New flake input - `nix-doom-emacs-unstraightened` added with empty nixpkgs follows (uses its own emacs-overlay) ### Updated `home/roles/emacs/default.nix` - Added `prebuiltDoom` option (default: `false`) - Standard mode: Original behavior, requires `doom sync` - Prebuilt mode: Uses `programs.doom-emacs` from nix-doom-emacs-unstraightened ### Updated `home/roles/emacs/doom/packages.el` - Pinned custom packages for deterministic builds: - `claude-code-ide` → `760240d7f03ff16f90ede9d4f4243cd94f3fed73` - `gptel-tool-library` → `baffc3b0d74a2b7cbda0d5cd6dd7726d6ccaca83` - `beads` → `f40a6461d3c0fa0969311bbb6a1e30d1bba86c88` ### Updated `home/home-live-usb.nix` - Enabled `emacs.prebuiltDoom = true` ## Usage For live USB (already enabled): ```nix emacs = { enable = true; prebuiltDoom = true; }; ``` For regular systems (unchanged default): ```nix emacs.enable = true; # Still uses traditional doom sync ``` ## Trade-offs - **Pro:** No `doom sync` needed, works offline, reproducible - **Con:** Doom config is read-only (stored in nix store) - **Con:** Build time increases due to package compilation --- **Bead:** nixos-configs-1wd
johno added 3 commits 2026-01-10 10:44:35 -08:00
Implement pre-built Doom Emacs packages for the live USB image, eliminating
the need to run `doom sync` after first boot.

Changes:
- Add nix-doom-emacs-unstraightened flake input
- Add homeModule to all three module sets (nixos, unstable, darwin)
- Add `prebuiltDoom` option to emacs role (default: false)
- Enable prebuiltDoom for live-usb configuration
- Pin custom packages in packages.el for deterministic builds:
  - claude-code-ide, gptel-tool-library, beads

When prebuiltDoom=true, all Doom packages are compiled at nix build time
using emacs-overlay. The doom configuration is stored in the nix store
(read-only), and no `doom sync` is required at runtime.

This is ideal for:
- Live USB images
- Immutable/reproducible systems
- Offline deployments

Closes: nixos-configs-1wd
johno merged commit 4fe531f87f into main 2026-01-10 12:33:44 -08:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: johno/nixos-configs#6