summaryrefslogtreecommitdiff
path: root/modules/overlays/emacs.nix
blob: 7ed96583ed111b7b768ab55371678239f622fc50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{ lib, config, ... }:

{
  options = {
    this.overlays.emacs.enable = lib.mkEnableOption "custom-built Emacs overlay";
  };

  config = lib.mkIf config.this.overlays.emacs.enable {
    nixpkgs.overlays = [
      (final: prev: {
        emacs = (prev.emacs.override {
          withNativeCompilation = false;
          withXwidgets = false;
          withX = true;
          withGTK3 = false;
          withAthena = false;
        }).overrideAttrs (attrs: with builtins; with attrs; {
          configureFlags = filter (f: !elem f
            ["--with-x-toolkit=lucid" "--with-toolkit-scroll-bars"])
            configureFlags ++ ["--with-x-toolkit=no" "--without-toolkit-scroll-bars"];
        });
      })
    ];
  };
}