Calum MacRae /home/cmacrae

A Nix overlay for Emacs 27 with the 'emacs-mac' patches

| 176 words | nix darwin emacs


The official emacs-macport package has been updated on the nixpkgs master branch, so should hit the nixpkgs-unstable channel soon!

With the recent release of Emacs 27.1, I figured I'd share a Nix overlay I'm using to build it with the 'emacs-mac' patches.

Emacs 27 comes with some great performance improvements. Including native JSON support, which makes for a really slick experience with lsp-mode. On top of that, it's really nice having Mitsuharu Yamamoto's patches to enhance the experience further on macOS, as things just play a lot nicer.

Emacs = (super.emacsMacport.overrideAttrs (o: rec {
  version = "27.1";
  macportVersion = "8.0";
  emacsName = "emacs-${version}";

  src = builtins.fetchurl {
    url = "${emacsName}.tar.xz";
    sha256 = "0h9f2wpmp6rb5rfwvqwv1ia1nw86h74p7hnz3vb3gjazj67i4k2a";

  macportSrc = builtins.fetchurl {
    url = "${emacsName}-mac-${macportVersion}.tar.gz";
    sha256 = "0rjk82k9qp1g701pfd4f0q2myzvsnp9q8xzphlxwi5yzwbs91kjq";

  patches = [];
  doCheck = false;
  installTargets = [ "tags" "install" ];
  buildInputs = o.buildInputs ++ [ super.jansson ];
  configureFlags = o.configureFlags ++ [ "--with-json" ];

At the moment, the tests aren't passing, so we need to pass doCheck = false - but I haven't experienced any issues yet!

Unless otherwise noted, the content of this site is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0).