Skip to content

Commit e6769e1

Browse files
author
faukah
committed
chore(flake.nix): cleanup, don't shadow pkgs
Signed-off-by: Amaan Qureshi <[email protected]>
1 parent 6d3245f commit e6769e1

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

flake.nix

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
);
5959
dune-static-overlay = _: super: {
6060
ocamlPackages = super.ocaml-ng.ocamlPackages_5_3.overrideScope (
61-
oself: osuper: {
61+
_: osuper: {
6262
dune_3 = osuper.dune_3.overrideAttrs (a: {
6363
src = ./.;
6464
preBuild = "ocaml boot/bootstrap.ml --static";
@@ -109,6 +109,7 @@
109109
in
110110
{
111111
default = self.packages.${system}.dune;
112+
112113
dune = pkgs.stdenv.mkDerivation {
113114
pname = "dune";
114115
version = "3.x-n/a";
@@ -168,9 +169,9 @@
168169
ocamlformat = builtins.getAttr ("ocamlformat_" + ocamlformat_version) pkgs;
169170

170171
testNativeBuildInputs =
171-
pkgs:
172+
p:
172173
[ ocamlformat ]
173-
++ (with pkgs; [
174+
++ (with p; [
174175
nodejs-slim
175176
pkg-config
176177
opam
@@ -186,9 +187,9 @@
186187
pkgs' =
187188
if duneFromScope then
188189
pkgs.extend (
189-
pself: psuper: {
190+
_: psuper: {
190191
ocamlPackages = psuper.ocamlPackages.overrideScope (
191-
oself: osuper: {
192+
_: _: {
192193
dune_3 = self.packages.${system}.default;
193194
}
194195
);
@@ -197,31 +198,29 @@
197198
else
198199
pkgs;
199200

200-
inherit (pkgs') writeScriptBin stdenv;
201-
202-
duneScript = writeScriptBin "dune" ''
203-
#!${stdenv.shell}
201+
duneScript = pkgs.writeScriptBin "dune" ''
202+
#!${pkgs.stdenv.shell}
204203
"$DUNE_SOURCE_ROOT"/_boot/dune.exe $@
205204
'';
206205
in
207206

208-
pkgs'.mkShell {
207+
pkgs.mkShell {
209208
shellHook = ''
210209
export DUNE_SOURCE_ROOT=$PWD
211210
'';
211+
inherit INSIDE_NIX;
212212
inherit meta;
213-
nativeBuildInputs = (testNativeBuildInputs pkgs') ++ [ duneScript ];
213+
nativeBuildInputs = [ duneScript ] ++ (testNativeBuildInputs pkgs');
214214
inputsFrom = [
215215
pkgs'.ocamlPackages.dune_3
216216
self.devShells.${system}.doc
217217
];
218218
buildInputs =
219-
with pkgs;
220-
[
219+
(with pkgs; [
221220
file
222221
mercurial
223222
unzip
224-
]
223+
])
225224
++ (with pkgs'.ocamlPackages; [
226225
ctypes
227226
cinaps
@@ -240,8 +239,7 @@
240239
uutf
241240
])
242241
++ (extraBuildInputs pkgs')
243-
++ lib.optionals stdenv.isLinux [ strace ];
244-
inherit INSIDE_NIX;
242+
++ lib.optionals pkgs.stdenv.isLinux [ pkgs.strace ];
245243
};
246244
in
247245
{
@@ -303,9 +301,7 @@
303301
};
304302

305303
slim-melange = makeDuneDevShell {
306-
extraBuildInputs = pkgs: [
307-
pkgs.ocamlPackages.melange
308-
];
304+
extraBuildInputs = p: [ p.ocamlPackages.melange ];
309305
meta.description = ''
310306
Provides a minimal shell environment built purely from nixpkgs
311307
that can run the testsuite (except the coq tests).
@@ -357,8 +353,8 @@
357353
};
358354

359355
microbench = makeDuneDevShell {
360-
extraBuildInputs = pkgs: [
361-
pkgs.ocamlPackages.core_bench
356+
extraBuildInputs = p: [
357+
p.ocamlPackages.core_bench
362358
];
363359
meta.description = ''
364360
Provides a minimal shell environment that can build the

0 commit comments

Comments
 (0)