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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
|
# This overlay is used to make TVL-specific modifications in the
# nixpkgs tree, where required.
{ lib, depot, localSystem, ... }:
self: super:
depot.nix.readTree.drvTargets {
nix_2_3 = (super.nix_2_3.override {
# flaky tests, long painful build, see https://github.com/NixOS/nixpkgs/pull/266443
withAWS = false;
}).overrideAttrs (_: {
# use TVL maintenance branch for 2.3, which has more fixes than upstream
CXXFLAGS = "--std=c++20 -g";
dontStrip = true;
src = self.fetchFromGitHub {
owner = "tvlfyi";
repo = "nix";
rev = "d516e2826128c09588535b67aa27fd3e24288b5f";
sha256 = "04yxxhhq4542gakfh2kylnhq9fagfzv63shrq0qvf8rajflwxr22";
};
});
nix = self.nix_2_3 // {
# avoid duplicate pipeline step
meta = self.nix_2_3.meta or { } // {
ci = self.nix_2_3.meta.ci or { } // {
skip = true;
};
};
};
nix_latest_stable = super.nix.override ({
# flaky tests, long painful build, see https://github.com/NixOS/nixpkgs/pull/266443
withAWS = false;
});
# No longer builds with Nix 2.3 after
# https://github.com/nixos/nixpkgs/commit/5f9d2d95721cdf20ace744f2db75ad70a7aedd3a
nixos-option = super.nixos-option.override {
nix = self.nix_latest_stable;
};
home-manager = super.home-manager.overrideAttrs (_: {
src = depot.third_party.sources.home-manager;
patches = [ ./patches/0001-home-environment-fix-compatibility-with-Nix-2.3.patch ];
version = "git-"
+ builtins.substring 0 7 depot.third_party.sources.home-manager.rev;
});
# Add our Emacs packages to the fixpoint
emacsPackagesFor = emacs: (
(super.emacsPackagesFor emacs).overrideScope (eself: esuper: {
tvlPackages = depot.tools.emacs-pkgs // depot.third_party.emacs;
# Use the notmuch from nixpkgs instead of from the Emacs
# overlay, to avoid versions being out of sync.
notmuch = super.notmuch.emacs;
# Build EXWM with the depot sources instead.
depotExwm = eself.callPackage depot.third_party.exwm.override { };
# Workaround for magit checking the git version at load time
magit = esuper.magit.overrideAttrs (_: {
propagatedNativeBuildInputs = [
self.git
];
});
# Pin xelb to a newer one until the new maintainers do a release.
xelb = eself.trivialBuild {
pname = "xelb";
version = "0.19-dev"; # invented version, last actual release was 0.18
src = self.fetchFromGitHub {
owner = "emacs-exwm";
repo = "xelb";
rev = "86089eba2de6c818bfa2fac075cb7ad876262798";
sha256 = "1mmlrd2zpcwiv8gh10y7lrpflnbmsycdascrxjr3bfcwa8yx7901";
};
};
# TODO(tazjin): remove after https://github.com/karthink/gptel/pull/906 is merged
gptel = esuper.gptel.overrideAttrs (old: {
version = "0.9.8.5";
src = self.fetchFromGitHub {
owner = "tazjin";
repo = "gptel";
rev = "8f8416b0b69fccfa559be4e05cb3214bd04edd6b";
sha256 = "1dxrqpd9siqd3yf5n4dwc03q23gjp7q07ay12hiw2z346zlszh6h";
};
});
# Override telega sources to specific commits, and check its exact tdlib version requirement.
checkedTelega =
esuper.telega.overrideAttrs (finalAttrs: oldAttrs:
let
# Find the actual tdlib version below without requiring any knowledge
# how it is actually wired up at the moment.
usedTdlibVersion = builtins.getAttr "version" (
lib.findFirst (drv: drv.pname == "tdlib")
(throw "BUG: checkedTelega: could not find tdlib in buildInputs")
finalAttrs.buildInputs
);
in
{
version = "0.8.999"; # unstable
src = self.fetchFromGitHub {
owner = "zevlg";
repo = "telega.el";
rev = "ff06f58364375c96477561f265e3dbf55a8ad231";
sha256 = "0bircjqj2zm67zspsy2r76zygvkxq6y65f3bchlhhhj1rr19kalh";
};
buildInputs = builtins.map
(drv: if drv.pname == "tdlib" then self.tdlibForTelega else drv)
oldAttrs.buildInputs;
nativeBuildInputs = oldAttrs.nativeBuildInputs or [ ] ++ [
self.buildPackages.ripgrep
];
postPatch = ''
${oldAttrs.postPatch or ""}
requiredTdlibVersion="$(rg -o -r '$1' 'tdlib_version=v(.*)$' etc/Dockerfile)"
if [[ "$requiredTdlibVersion" != "${usedTdlibVersion}" ]]; then
echo "nixpkgs or tvl overlay tdlib version (${usedTdlibVersion}) doesn't match expected $requiredTdlibVersion"
echo "ping tazjin if you see this message"
exit 1
fi
'';
}
);
})
);
# Backpin tdlib to match telega (which doesn't support the latest version of
# tdlib yet), reverting https://github.com/NixOS/nixpkgs/pull/388066
tdlibForTelega = self.tdlib.overrideAttrs (_: {
version = "1.8.45";
src = self.fetchFromGitHub {
owner = "tdlib";
repo = "td";
rev = "521aed8e4";
sha256 = "08pqqir0m0wkk2c5lpijb9gslv0wk7msvf0s6v9aczzwj18pq3jm";
};
});
# dottime support for notmuch
notmuch = super.notmuch.overrideAttrs (old: {
passthru = old.passthru // {
patches = old.patches ++ [ ./patches/notmuch-dottime.patch ];
};
});
# Avoid builds of mkShell derivations in CI.
mkShell = super.lib.makeOverridable (args: (super.mkShell args).overrideAttrs (_: {
passthru = {
meta.ci.skip = true;
};
}));
crate2nix = super.crate2nix.overrideAttrs (old: {
patches = old.patches or [ ] ++ [
# TODO(Kranzes): Remove in next release.
./patches/crate2nix-0001-Fix-Use-mkDerivation-with-src-instead-of-runCommand.patch
# https://github.com/nix-community/crate2nix/pull/301
./patches/crate2nix-tests-debug.patch
];
});
evans = super.evans.overrideAttrs (old: {
patches = old.patches or [ ] ++ [
# add support for unix domain sockets
# https://github.com/ktr0731/evans/pull/680
./patches/evans-add-support-for-unix-domain-sockets.patch
];
});
# Dependency isn't supported by Python 3.12
html5validator = super.html5validator.override {
python3 = self.python311;
};
# macFUSE bump containing fix for https://github.com/osxfuse/osxfuse/issues/974
# https://github.com/NixOS/nixpkgs/pull/320197
fuse =
if super.stdenv.isDarwin then
super.fuse.overrideAttrs
(old: rec {
version = "4.8.0";
src = super.fetchurl {
url = "https://github.com/osxfuse/osxfuse/releases/download/macfuse-${version}/macfuse-${version}.dmg";
hash = "sha256-ucTzO2qdN4QkowMVvC3+4pjEVjbwMsB0xFk+bvQxwtQ=";
};
}) else super.fuse;
# somebody renamed 'utillinux' upstream, but didn't rename all use-cases,
# leading to some packages being broken.
#
# temporarily restore the old name to make things work again.
utillinux = self.util-linux;
# harmonia >2.0 broke compatibility with Nix 2.3; revert back for now
harmonia = self.rustPlatform.buildRustPackage rec {
pname = "harmonia";
version = "1.0.2";
doCheck = false;
cargoHash = "sha256:0p31w7gimhgib8fiskx55jnx8l3w7jpjjxm23qdmzpi772y3xkvk";
meta.mainProgram = "harmonia";
src = self.fetchFromGitHub {
owner = "nix-community";
repo = "harmonia";
rev = "refs/tags/harmonia-v${version}";
hash = "sha256-72nDVSvUfZsLa2HbyricOpA0Eb8gxs/VST25b6DNBpM=";
};
nativeBuildInputs = with self; [
pkg-config
nixVersions.nix_2_24
];
buildInputs = with self; [
boost
libsodium
openssl
nlohmann_json
nixVersions.nix_2_24
];
};
}
|