about summary refs log tree commit diff
path: root/infra/nixos/emacs.nix
blob: 24426bc4381c3db36f8d4b2c9e7b5e18117ad571 (plain) (blame)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Derivation for Emacs pre-configured with packages that I need.
#
# TODO: Fix sly (again)

{ pkgs }:

with pkgs; with emacsPackagesNg;
let emacsWithPackages = (emacsPackagesNgGen emacs).emacsWithPackages;

# As the EXWM-README points out, XELB should be built from source if
# EXWM is.
xelb = melpaBuild {
  pname   = "xelb";
  ename   = "xelb";
  version = "0.15";
  recipe  = builtins.toFile "recipe" ''
    (xelb :fetcher github
          :repo "ch11ng/xelb")
  '';

  packageRequires = [ cl-generic emacs ];

  src = fetchFromGitHub {
    owner  = "ch11ng";
    repo   = "xelb";
    rev    = "b8f168b401977098fe2b30f4ca32629c0ab6eb83";
    sha256 = "1ack1h68x8ia0ji6wbhmayrakq35p5sgrrl6qvha3ns3pswc0pl9";
 };
};

# EXWM pinned to a newer version than what is released due to a
# potential fix for ch11ng/exwm#425.
exwm = melpaBuild {
  pname   = "exwm";
  ename   = "exwm";
  version = "0.19";
  recipe  = builtins.toFile "recipe" ''
    (exwm :fetcher github
          :repo "ch11ng/exwm")
  '';

  packageRequires = [ xelb ];

  src = fetchFromGitHub {
    owner  = "ch11ng";
    repo   = "exwm";
    rev    = "472f7cb82b67b98843f10c12e6bda9b8ae7262bc";
    sha256 = "19gflsrb19aijf2xcw7j2m658qad21nbwziw38s1h2jw66vhk8dj";
 };
};

slyFixed = sly.overrideAttrs(_: {
  recipe = builtins.toFile "recipe" ''
(sly :repo "joaotavora/sly"
     :fetcher github
     :files ("*.el"
             ("lib" "lib/*")
             ("contrib" "contrib/*")
             "doc/*.texi"
             "doc/*.info"
             "doc/dir"))
'';
});

in emacsWithPackages(epkgs:
  # Actual ELPA packages (the enlightened!)
  (with epkgs.elpaPackages; [
    ace-window
    avy
    company
    pinentry
    rainbow-mode
    undo-tree
    which-key
  ]) ++

  # MELPA packages:
  (with epkgs.melpaPackages; [
    browse-kill-ring
    cargo
    counsel
    counsel-notmuch
    dash
    dash-functional
    dockerfile-mode
    edit-server
    eglot
    elixir-mode
    erlang
    elm-mode
    exwm
    go-mode
    gruber-darker-theme
    haskell-mode
    ht
    hydra
    idle-highlight-mode
    intero
    ivy
    ivy-pass
    ivy-prescient
    jq-mode
    kotlin-mode
    magit
    markdown-mode
    markdown-toc
    meghanada
    multi-term
    multiple-cursors
    nginx-mode
    nix-mode
    omnisharp
    paredit
    password-store
    pg
    pkgs.notmuch
    prescient
    rainbow-delimiters
    restclient
    rust-mode
    s
    slyFixed
    smartparens
    string-edit
    swiper
    telephone-line
    terraform-mode
    toml-mode
    use-package
    uuidgen
    web-mode
    websocket
    yaml-mode
  ]) ++

  # Custom packaged Emacs packages:
  [ xelb exwm ]
)