Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use overrideScope' with Emacs configured via programs.emacs #486

Closed
terlar opened this issue Dec 6, 2018 · 1 comment
Closed

Comments

@terlar
Copy link
Contributor

terlar commented Dec 6, 2018

Reading through the documentation at:
https://nixos.org/nixpkgs/manual/#sec-emacs-config

I see that the recommended way to override packages is through the following method:

overrides = self: super: 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
])

However it seems to be no way to hook into that part via home-manager.

It is possible to set emacs and the last of packages through package and extraPackages. Perhaps introduce a configuration option called overrides?
If it is defined it would wrap the command with overrideScope'.

Is this understanding correct?

rycee added a commit that referenced this issue Dec 17, 2018
This option enables overriding packages within the generated Emacs
package set.

Fixes #486
@rycee
Copy link
Member

rycee commented Dec 17, 2018

Yeah, you made a good point! The current design didn't allow such overrides. I added an programs.emacs.overrides option in the referenced PR. Can be used like so:

programs.emacs.overrides = self: super: {
  haskell-mode = self.melpaPackages.haskell-mode;
};

marzipankaiser pushed a commit to marzipankaiser/home-manager that referenced this issue Dec 18, 2018
This option enables overriding packages within the generated Emacs
package set.

Fixes nix-community#486
rycee added a commit that referenced this issue Dec 24, 2018
This option enables overriding packages within the generated Emacs
package set.

Fixes #486

(cherry picked from commit e68d6e7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants