NixOS / NixOS/nixpkgs

Manual example for building Emacs with packages does not build

Open
#424,472 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0.kind: enhancement 2.status: stale 6.topic: docs.nixos.org 6.topic: emacs 9.needs: documentation
Dominant language
Nix
Stars
26.2k
Forks
20.1k
PR merge metrics
PR metrics pending

Description

Describe the problem

I was trying to use "Example 7. Nix expression to build Emacs with packages (emacs.nix)" from the NixOS manual as a example for my own configuration, and when it didn't work, I did a sanity check and tried building the example code. I copied and pasted it into a file named "emacs.nix" and ran nix-build emacs.nix as recommended by the manual.

Here are the errors that I got:

error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:37:12:
           36|
           37|   strict = derivationStrict drvAttrs;
             |            ^
           38|

       … while evaluating derivation 'emacs-with-packages-30.1'
         whose name attribute is located at /nix/store/nrfgfqpdc5rdx8dd4h7y60c3h0qi100y-nixos-25.05/nixos/pkgs/stdenv/generic/make-derivation.nix:480:13

       … while evaluating attribute 'deps' of derivation 'emacs-with-packages-30.1'
         at /nix/store/nrfgfqpdc5rdx8dd4h7y60c3h0qi100y-nixos-25.05/nixos/pkgs/applications/editors/emacs/build-support/wrapper.nix:63:5:
           62|     # one path to the load lists
           63|     deps =
             |     ^
           64|       runCommand "emacs-packages-deps"

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: undefined variable 'undo-tree'
       at /home/jjramsey/test-emacs-build/emacs.nix:40:5:
           39|   ++ (with epkgs.melpaPackages; [
           40|     undo-tree      # ; <C-x u> to show the undo tree
             |     ^
           41|     zoom-frm       # ; increase/decrease font size for all buffers %lt;C-x C-+>

Interestingly enough, this was similar to the error I got (except I was trying to install kdl-mode from melpaPackages), but got the same complaint about missing documentation

Proposed solution

Notify maintainers

Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs
Is this issue important to you?

Add a 👍 reaction to issues you find important.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Example 7, “Nix expression to build Emacs with packages (emacs.nix),” in the NixOS manual and reproduce the failure by copying it to emacs.nix and running nix-build emacs.nix. Check why the documented undo-tree package is undefined, then verify that the example builds successfully.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, documentation
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.