Merge pull request #31312 from binarin/emacs-package-set-overrides
emacs-packages: Cleanup and document for overrides
This commit is contained in:
commit
8eba2a5be8
|
@ -660,6 +660,32 @@ cp ${myEmacsConfig} $out/share/emacs/site-lisp/default.el
|
||||||
passing <command>-q</command> to the Emacs command.
|
passing <command>-q</command> to the Emacs command.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Sometimes <varname>emacsWithPackages</varname> is not enough, as
|
||||||
|
this package set has some priorities imposed on packages (with
|
||||||
|
the lowest priority assigned to Melpa Unstable, and the highest for
|
||||||
|
packages manually defined in
|
||||||
|
<filename>pkgs/top-level/emacs-packages.nix</filename>). But you
|
||||||
|
can't control this priorities when some package is installed as a
|
||||||
|
dependency. You can override it on per-package-basis, providing all
|
||||||
|
the required dependencies manually - but it's tedious and there is
|
||||||
|
always a possibility that an unwanted dependency will sneak in
|
||||||
|
through some other package. To completely override such a package
|
||||||
|
you can use <varname>overrideScope</varname>.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<screen>
|
||||||
|
overrides = super: self: rec {
|
||||||
|
haskell-mode = self.melpaPackages.haskell-mode;
|
||||||
|
...
|
||||||
|
};
|
||||||
|
((emacsPackagesNgGen emacs).overrideScope overrides).emacsWithPackages (p: with p; [
|
||||||
|
# here both these package will use haskell-mode of our own choice
|
||||||
|
ghc-mod
|
||||||
|
dante
|
||||||
|
])
|
||||||
|
</screen>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
|
@ -14953,8 +14953,6 @@ with pkgs;
|
||||||
emacs25Packages = emacsPackagesGen emacs25 pkgs.emacs25Packages;
|
emacs25Packages = emacsPackagesGen emacs25 pkgs.emacs25Packages;
|
||||||
|
|
||||||
emacsPackagesNgGen = emacs: import ./emacs-packages.nix {
|
emacsPackagesNgGen = emacs: import ./emacs-packages.nix {
|
||||||
overrides = (config.emacsPackageOverrides or (p: {})) pkgs;
|
|
||||||
|
|
||||||
inherit lib newScope stdenv;
|
inherit lib newScope stdenv;
|
||||||
inherit fetchFromGitHub fetchgit fetchhg fetchurl;
|
inherit fetchFromGitHub fetchgit fetchhg fetchurl;
|
||||||
inherit emacs texinfo makeWrapper runCommand;
|
inherit emacs texinfo makeWrapper runCommand;
|
||||||
|
|
|
@ -32,9 +32,7 @@
|
||||||
# `meta` with `platforms` and `homepage` set to something you are
|
# `meta` with `platforms` and `homepage` set to something you are
|
||||||
# unlikely to want to override for most packages
|
# unlikely to want to override for most packages
|
||||||
|
|
||||||
{ overrides
|
{ lib, newScope, stdenv, fetchurl, fetchgit, fetchFromGitHub, fetchhg, runCommand
|
||||||
|
|
||||||
, lib, newScope, stdenv, fetchurl, fetchgit, fetchFromGitHub, fetchhg, runCommand
|
|
||||||
|
|
||||||
, emacs, texinfo, lndir, makeWrapper
|
, emacs, texinfo, lndir, makeWrapper
|
||||||
, trivialBuild
|
, trivialBuild
|
||||||
|
|
Loading…
Reference in a new issue