Using overlays to override package options -- Emacs


I’ve been trying to use an overlay to configure set some Emacs build
options – dropping GTK3 in favor of GTK2/Athena. In doing so, no build
that I’ve had has done so. How can I go about doing so?

Current overlay is as follows:

self: super: {
  emacs = super.emacs.override {
    withGTK2 = false;
    withGTK3 = false;
    withXwidgets = false;
    withX = true;

Any and all help is appreciated.



1 Like

Did you ever figure out how to do this?

I wanted to try emacs with lucid instead of gtk3, and this this works for me:

self: super: {
  emacs = super.emacs.overrideAttrs (old: {
    configureFlags = (old.configureFlags or []) ++ ["--with-x-toolkit=lucid"];

so maybe try:

self: super: {
  emacs = super.emacs.overrideAttrs (old: {
    configureFlags = (old.configureFlags or []) ++ ["--with-x-toolkit=gtk2"];

It seems to me that a more robust and elegant solution would achieve the same by overriding toolkit with "gtk2" or "lucid", but I couldn’t/didn’t figure out how to do that.

Hope this helps

Welcome to the community. After checking the generic emacs expression, it appears that you must provide a gtk[23]-x11 as part of the override, as by default they are both set to null. Try passing them from super. Also, if I understood you correctly (I don’t use emacs so I don’t know), you are trying to use gtk2, but in your expression you have gtk2 set to false.


final: prev: {
  emacs = prev.emacs.override {
    inherit (prev) gtk2-x11;
    withGTK2 = true;