nixpkgs/pkgs/top-level/emacs-packages.nix

90 lines
2.8 KiB
Nix
Raw Normal View History

# package.el-based emacs packages
## FOR USERS
#
# Recommended: simply use `emacsWithPackages` with the packages you want.
#
# Alternative: use `emacs`, install everything to a system or user profile
# and then add this at the start your `init.el`:
/*
(require 'package)
;; optional. makes unpure packages archives unavailable
(setq package-archives nil)
;; optional. use this if you install emacs packages to the system profile
(add-to-list 'package-directory-list "/run/current-system/sw/share/emacs/site-lisp/elpa")
;; optional. use this if you install emacs packages to user profiles (with nix-env)
(add-to-list 'package-directory-list "~/.nix-profile/share/emacs/site-lisp/elpa")
(package-initialize)
*/
## FOR CONTRIBUTORS
#
# When adding a new package here please note that
# * please use `elpaBuild` for pre-built package.el packages and
# `melpaBuild` or `trivialBuild` if the package must actually
# be built from the source.
# * lib.licenses are `with`ed on top of the file here
# * both trivialBuild and melpaBuild will automatically derive a
# `meta` with `platforms` and `homepage` set to something you are
# unlikely to want to override for most packages
{ pkgs, lib ? pkgs.lib, emacs }:
2015-12-15 17:57:51 +00:00
let
trivialBuild = pkgs.callPackage ../build-support/emacs/trivial.nix {
inherit emacs;
};
melpaBuild = pkgs.callPackage ../build-support/emacs/melpa.nix {
inherit emacs;
};
mkElpaPackages = import ../applications/editors/emacs-modes/elpa-packages.nix {
inherit (pkgs) stdenv texinfo writeText;
inherit lib;
};
# Contains both melpa stable & unstable
melpaGeneric = import ../applications/editors/emacs-modes/melpa-packages.nix {
inherit lib pkgs;
};
mkMelpaStablePackages = melpaGeneric "stable";
mkMelpaPackages = melpaGeneric "unstable";
mkOrgPackages = import ../applications/editors/emacs-modes/org-packages.nix {
inherit lib;
};
emacsWithPackages = import ../build-support/emacs/wrapper.nix {
inherit (pkgs) lndir makeWrapper runCommand;
inherit lib;
};
mkManualPackages = import ../applications/editors/emacs-modes/manual-packages.nix {
inherit lib pkgs;
2015-12-15 17:57:51 +00:00
};
2015-12-06 19:17:41 +00:00
in lib.makeScope pkgs.newScope (self: lib.makeOverridable ({
elpaPackages ? mkElpaPackages self
, melpaStablePackages ? mkMelpaStablePackages self
, melpaPackages ? mkMelpaPackages self
, orgPackages ? mkOrgPackages self
, manualPackages ? mkManualPackages self
}: ({}
// elpaPackages // { inherit elpaPackages; }
// melpaStablePackages // { inherit melpaStablePackages; }
// melpaPackages // { inherit melpaPackages; }
// orgPackages // { inherit orgPackages; }
// manualPackages // { inherit manualPackages; }
// {
inherit emacs melpaBuild trivialBuild;
emacsWithPackages = emacsWithPackages self;
withPackages = emacsWithPackages self;
})
) {})