forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
emacs-packages.nix
159 lines (137 loc) · 4.19 KB
/
emacs-packages.nix
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# package.el-based emacs packages
## FOR USERS
#
# Recommended: simply use `emacsWithPackages` with the packages you want.
#
# Alternative: use `emacs`, install everything to a system or user profile
# and then add this at the start your `early-init.el`:
/*
;; optional. use this if you install emacs packages to the system profile
(add-to-list 'package-directory-list "/run/current-system/sw/share/emacs/site-lisp/elpa")
;; optional. use this if you install emacs packages to user profiles (with nix-env)
(add-to-list 'package-directory-list "~/.nix-profile/share/emacs/site-lisp/elpa")
*/
{
pkgs',
emacs',
makeScope,
makeOverridable,
dontRecurseIntoAttrs,
}:
let
mkElpaDevelPackages =
{ pkgs, lib }:
import ../applications/editors/emacs/elisp-packages/elpa-devel-packages.nix {
inherit (pkgs) pkgs buildPackages;
inherit lib;
};
mkElpaPackages =
{ pkgs, lib }:
import ../applications/editors/emacs/elisp-packages/elpa-packages.nix {
inherit (pkgs) pkgs buildPackages;
inherit lib;
};
mkNongnuDevelPackages =
{ pkgs, lib }:
import ../applications/editors/emacs/elisp-packages/nongnu-devel-packages.nix {
inherit (pkgs) pkgs buildPackages;
inherit lib;
};
mkNongnuPackages =
{ pkgs, lib }:
import ../applications/editors/emacs/elisp-packages/nongnu-packages.nix {
inherit (pkgs) pkgs buildPackages;
inherit lib;
};
# Contains both melpa stable & unstable
melpaGeneric =
{ pkgs, lib }:
import ../applications/editors/emacs/elisp-packages/melpa-packages.nix {
inherit lib pkgs;
};
mkManualPackages =
{ pkgs, lib }:
import ../applications/editors/emacs/elisp-packages/manual-packages.nix {
inherit lib pkgs;
};
emacsWithPackages =
{ pkgs, lib }:
pkgs.callPackage ../applications/editors/emacs/build-support/wrapper.nix {
inherit (pkgs.xorg) lndir;
inherit lib;
};
in
makeScope pkgs'.newScope (
self:
makeOverridable (
{
pkgs ? pkgs',
lib ? pkgs.lib,
elpaDevelPackages ? mkElpaDevelPackages { inherit pkgs lib; } self,
elpaPackages ? mkElpaPackages { inherit pkgs lib; } self,
nongnuDevelPackages ? mkNongnuDevelPackages { inherit pkgs lib; } self,
nongnuPackages ? mkNongnuPackages { inherit pkgs lib; } self,
melpaStablePackages ? melpaGeneric { inherit pkgs lib; } "stable" self,
melpaPackages ? melpaGeneric { inherit pkgs lib; } "unstable" self,
manualPackages ? mkManualPackages { inherit pkgs lib; } self,
}:
(
{ }
// elpaDevelPackages
// {
inherit elpaDevelPackages;
}
// elpaPackages
// {
inherit elpaPackages;
}
// nongnuDevelPackages
// {
inherit nongnuDevelPackages;
}
// nongnuPackages
// {
inherit nongnuPackages;
}
// melpaStablePackages
// {
inherit melpaStablePackages;
}
// melpaPackages
// {
inherit melpaPackages;
}
// manualPackages
// {
inherit manualPackages;
}
// {
# Propagate overridden scope
emacs = emacs'.overrideAttrs (old: {
passthru = (old.passthru or { }) // {
pkgs = dontRecurseIntoAttrs self;
};
});
trivialBuild = pkgs.callPackage ../applications/editors/emacs/build-support/trivial.nix {
inherit (self) emacs;
};
elpaBuild = pkgs.callPackage ../applications/editors/emacs/build-support/elpa.nix {
inherit (self) emacs;
};
melpaBuild = pkgs.callPackage ../applications/editors/emacs/build-support/melpa.nix {
inherit (self) emacs;
};
emacsWithPackages = emacsWithPackages { inherit pkgs lib; } self;
withPackages = emacsWithPackages { inherit pkgs lib; } self;
}
// {
# Package specific priority overrides goes here
# EXWM is not tagged very often, prefer it from elpa devel.
inherit (elpaDevelPackages) exwm;
# Telega uploads packages incompatible with stable tdlib to melpa
# Prefer the one from melpa stable
inherit (melpaStablePackages) telega;
}
)
) { }
)