3
0
Fork 0
forked from mirrors/nixpkgs

emacs-packages: Add overriding capability to emacsPackagesNg

This allows overriding the individual package sets composing
emacsPackagesNg.

Example:
```
myEmacsPackages = emacsPackagesNg.override {
  melpaPackages = {};
};
```
This commit is contained in:
adisbladis 2019-08-04 21:44:07 +01:00
parent d490bcdf0f
commit 97a069609f
No known key found for this signature in database
GPG key ID: 110BFAD44C6249B7
3 changed files with 24 additions and 27 deletions

View file

@ -50,4 +50,4 @@ self:
elpaPackages = super // overrides; elpaPackages = super // overrides;
in elpaPackages // { inherit elpaBuild elpaPackages; } in elpaPackages // { inherit elpaBuild; }

View file

@ -28,4 +28,4 @@ self:
orgPackages = super // overrides; orgPackages = super // overrides;
in orgPackages // { inherit orgPackages; } in orgPackages

View file

@ -46,7 +46,7 @@ with lib.licenses;
let let
elpaPackages = import ../applications/editors/emacs-modes/elpa-packages.nix { mkElpaPackages = import ../applications/editors/emacs-modes/elpa-packages.nix {
inherit lib stdenv texinfo; inherit lib stdenv texinfo;
}; };
@ -54,28 +54,16 @@ let
melpaGeneric = import ../applications/editors/emacs-modes/melpa-packages.nix { melpaGeneric = import ../applications/editors/emacs-modes/melpa-packages.nix {
inherit external lib pkgs; inherit external lib pkgs;
}; };
mkMelpaStablePackages = melpaGeneric "stable";
mkMelpaPackages = melpaGeneric "unstable";
melpaStablePackages = self: let mkOrgPackages = import ../applications/editors/emacs-modes/org-packages.nix { };
m = melpaGeneric "stable" self;
in {melpaStablePackages = m;} // m;
melpaPackages = self: let
m = melpaGeneric "unstable" self;
in {melpaPackages = m;} // m;
orgPackages = import ../applications/editors/emacs-modes/org-packages.nix { };
emacsWithPackages = import ../build-support/emacs/wrapper.nix { emacsWithPackages = import ../build-support/emacs/wrapper.nix {
inherit lib lndir makeWrapper stdenv runCommand; inherit lib lndir makeWrapper stdenv runCommand;
}; };
packagesFun = self: with self; { mkManualPackages = self: with self; {
inherit emacs melpaBuild trivialBuild;
emacsWithPackages = emacsWithPackages self;
## START HERE
elisp-ffi = melpaBuild rec { elisp-ffi = melpaBuild rec {
pname = "elisp-ffi"; pname = "elisp-ffi";
@ -221,11 +209,20 @@ let
}; };
in lib.makeScope newScope (self: in lib.makeScope newScope (self: lib.makeOverridable ({
removeAttrs ({} elpaPackages ? mkElpaPackages self
// elpaPackages self , melpaStablePackages ? mkMelpaStablePackages self
// melpaStablePackages self , melpaPackages ? mkMelpaPackages self
// melpaPackages self , orgPackages ? mkOrgPackages self
// orgPackages self , manualPackages ? mkManualPackages self
// packagesFun self) [ "override" "overrideDerivation" ] }: ({}
) // elpaPackages // { inherit elpaPackages; }
// melpaStablePackages // { inherit melpaStablePackages; }
// melpaPackages // { inherit melpaPackages; }
// orgPackages // { inherit orgPackages; }
// manualPackages
// {
inherit emacs melpaBuild trivialBuild;
emacsWithPackages = emacsWithPackages self;
})
) {})