Bleeding edge emacs overlay [maintainer=@adisbladis]
Find a file
Matt Jones e09ec4720e
Run the updater every 4 hours
Co-authored-by: Kim Lindberger <kim.lindberger@gmail.com>
2021-04-07 08:59:21 -04:00
.github/workflows Run the updater every 4 hours 2021-04-07 08:59:21 -04:00
hydra Stop using deprecated "nixpkgs-channels" repo 2020-11-26 16:01:27 -08:00
patches emacs: Remove clean-env patches 2021-02-25 14:32:26 +02:00
repos Updated repos/melpa 2021-04-07 03:13:44 +00:00
default.nix Fix arg overriding evaluation order 2021-02-27 10:20:26 +02:00
elisp.nix Default alwaysEnsure to null-as-false, only warn if it wasn't passed 2021-02-18 14:22:52 -05:00
flake.nix Update flake.nix 2020-08-14 21:14:44 +02:00
packreq.nix Renamed packageFile arg to packageElisp for clarity 2020-06-21 15:36:01 +12:00
parse.nix Allow leaf to be used as an alternative to use-package.. 2020-12-27 11:24:17 +01:00
README.org README: Move known words to the end of the buffer 2021-03-18 20:22:58 +01:00
update Port CI over to Gitlab CI from Buildkite 2019-08-17 23:55:02 +01:00

Emacs overlay for Nixpkgs

Contents of the overlay

Elpa

Daily generations of Elpa.

Melpa / Melpa stable

Daily generations of Melpa & Melpa stable attribute sets.

EXWM & needed dependencies

This overlay provides fresh versions of EXWM and dependencies. This is updated daily.

Emacs from Git and latest (including pre-releases)

This overlay also provides two versions (latest from git) for Emacs. These are updated daily.

These attributes are named emacsGit and emacsUnstable. emacsGit is built from the latest master branch and emacsUnstable is built from the latest tag.

Emacs from git is not guaranteed stable and may break your setup at any time, if it breaks you get to keep both pieces.

The feature/native-comp branch is also provided under the attribute emacsGcc. This is to be considered highly experimental.

We also provide two attributes named emacsGit-nox and emacsUnstable-nox if you wish to have Emacs built without X dependencies, as well as the experimental pgtk branch which supports Wayland natively.

Extra library functionality

This overlay comes with extra functions to generate an Emacs closure from various types of dependency declaration. (These are abstractions on top of emacsWithPackages.)

For example, emacsWithPackagesFromUsePackage adds packages which are required in a user's config via use-package or leaf.

  {
    environment.systemPackages = [
      (emacsWithPackagesFromUsePackage {
        # Your Emacs config file. Org mode babel files are also
        # supported.
        # NB: Config files cannot contain unicode characters, since
        #     they're being parsed in nix, which lacks unicode
        #     support.
        # config = ./emacs.org;
        config = ./emacs.el;

        # Package is optional, defaults to pkgs.emacs
        package = pkgs.emacsGit;

        # By default emacsWithPackagesFromUsePackage will only pull in
        # packages with `:ensure`, `:ensure t` or `:ensure <package name>`.
        # Setting `alwaysEnsure` to `true` emulates `use-package-always-ensure`
        # and pulls in all use-package references not explicitly disabled via
        # `:ensure nil` or `:disabled`.
        # Note that this is NOT recommended unless you've actually set
        # `use-package-always-ensure` to `t` in your config.
        alwaysEnsure = true;

        # For Org mode babel files, by default only code blocks with
        # `:tangle yes` are considered. Setting `alwaysTangle` to `true`
        # will include all code blocks missing the `:tangle` argument,
        # defaulting it to `yes`.
        # Note that this is NOT recommended unless you have something like
        # `#+PROPERTY: header-args:emacs-lisp :tangle yes` in your config,
        # which defaults `:tangle` to `yes`.
        alwaysTangle = true;

        # Optionally provide extra packages not in the configuration file.
        extraEmacsPackages = epkgs: [
          epkgs.cask
        ];

        # Optionally override derivations.
        override = epkgs: epkgs // {
          weechat = epkgs.melpaPackages.weechat.overrideAttrs(old: {
            patches = [ ./weechat-el.patch ];
          });
        };
      })
    ];
  }

Similarly, emacsWithPackagesFromPackageRequires adds packages which are declared in a .el package file's Package-Requires header, which can be handy for CI purposes:

...
let
  emacsForCI = pkgs.emacsWithPackagesFromPackageRequires {
    packageElisp = builtins.readFile ./flycheck.el;
    extraEmacsPackages = epkgs: [
      epkgs.package-lint
    ];
  };
pkgs.mkShell {
  buildInputs = [ emacsForCI ];
}

Usage of the overlay

Latest master each rebuild

One way, and probably the most convenient way to pull in this overlay is by just fetching the tarball of latest master on rebuild.

This has side-effects if packages breaks or things like that you may want to be in control of which revision of the overlay you run.

Adding the overlay this way will extend your Emacs packages set to contain the latest EXWM and dependencies from their respective master and make the package emacsGit available. These of course change quite rapidly and will cause compilation time.

{
  nixpkgs.overlays = [
    (import (builtins.fetchTarball {
      url = https://github.com/nix-community/emacs-overlay/archive/master.tar.gz;
    }))
  ];
}

Binary cache

You will want to use the nix-community binary cache. Where the overlay's build artefacts are pushed. See here for installation instructions.

Install directly from the overlay

The repository is meant to be used as an overlay as is explained above. Still, for experimental purposes, you might want to install a package directly from the overlay. For example, you can install emacsGit from a clone of this repository with the following command:

  nix-build --expr 'with (import <nixpkgs> { overlays = [ (import ./.) ]; }); emacsGit'

Community

IRC

#nixos-emacs on freenode

Nixpkgs issues