How to install Emacs 27 in NixOS?

Hi folks, I just switched from Manjaro to NixOS and I need a Emacs 27 instead of the default version 26.

Is there a simple way, I mean a piece of configuration that I can copy/paste. Appreciate for the help!

(Chinese input method is not ready yet, bear with my English)

You can write nix package by yourself, but you can also use emacs-overlay for convenience.

Import this overlay, than install emacsUnstable(for 27.0.91).

You may also install emacsGit (master branch)

P.S. I trash my nix config after I found guix, so I 'm sorry for the missing example

1 个赞

I’ve no experience, but see someones use it:

and discussion on reddit

Thanks, It works.

However it will download everytime I rebuild configuration, how to prevent this?

I also want to know, where is the documentation for those nix APIs in configuration.nix.

你是指下载什么?只知道nix会用Github下载zip的接口去下载emacs tarball。

暂时还没有统一的API文档查阅接口,各种函数的用法分散来nix manual,nixpkg manual,nixos manual等等等……。只知道有个options查询接口

可以加群咨询对Nix更熟悉的用户 Telegram: Contact @NixOS_zh

I mean download this file

Looks like there’s no cache for it :frowning:

A hacky solution: clone repo to your disk, then set the overlay source to the git repository in your file system.

You may need to dig into the source of Nix.