1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-30 17:41:12 +00:00
nixpkgs/pkgs/top-level/emacs-packages.nix
adisbladis 6347f78fd9
emacsPackages*: Move to emacs*.pkgs
This makes it much easier to create customisations around emacs via
the a new convenience passthru attr:
- `emacs.pkgs`: What used to be emacsPackages is now `emacs.pkgs`

The previous versioned names `emacs*Packages` have been moved to
aliases.nix and are now considered deprecated in favour of `emacs*.pkgs`.
2021-01-13 17:04:55 +01:00

88 lines
2.7 KiB
Nix

# 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
{ lib, newScope, stdenv, fetchurl, fetchFromGitHub, runCommand, writeText
, emacs, texinfo, lndir, makeWrapper
, trivialBuild
, melpaBuild
, external
, pkgs
}:
let
mkElpaPackages = import ../applications/editors/emacs-modes/elpa-packages.nix {
inherit lib stdenv texinfo;
};
# Contains both melpa stable & unstable
melpaGeneric = import ../applications/editors/emacs-modes/melpa-packages.nix {
inherit external 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 lib lndir makeWrapper runCommand;
};
mkManualPackages = import ../applications/editors/emacs-modes/manual-packages.nix {
inherit external lib pkgs;
};
in lib.makeScope 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;
})
) {})