emacs-overlay/flake.nix
Lin Jian c91c353b5d
Split into two overlays: one for emacs and one for emacs packages
Emacs packages in nixpkgs have binary cache since [1]. It is useful to
split the whole overlay into two seperated ones so that users can use
emacs packages in nixpkgs with emacsWithPackagesFromUsePackage or
emacsWithPackagesFromPackageRequires in this overlay.

[1]: https://github.com/NixOS/nixpkgs/pull/188110
2022-10-04 23:16:07 +08:00

39 lines
1.1 KiB
Nix

{
description = "Bleeding edge Emacs overlay";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs =
{ self
, nixpkgs
, flake-utils
}: {
# self: super: must be named final: prev: for `nix flake check` to be happy
overlays = {
default = final: prev: import ./overlays final prev;
emacs = final: prev: import ./overlays/emacs.nix final prev;
package = final: prev: import ./overlays/package.nix final prev;
};
# for backward compatibility, is safe to delete, not referenced anywhere
overlay = self.overlays.default;
} // flake-utils.lib.eachDefaultSystem (system: (
let
pkgs = import nixpkgs {
inherit system;
config.allowAliases = false;
overlays = [ self.overlays.default ];
};
inherit (pkgs) lib;
overlayAttrs = builtins.attrNames (import ./. pkgs pkgs);
in
{
packages =
let
drvAttrs = builtins.filter (n: lib.isDerivation pkgs.${n}) overlayAttrs;
in
lib.listToAttrs (map (n: lib.nameValuePair n pkgs.${n}) drvAttrs);
}
));
}