Skip to content

Commit e97c079

Browse files
authored
Reformat flake file (#12624)
* chore: nix formatting Signed-off-by: Rudi Grinberg <[email protected]>
1 parent bd4255f commit e97c079

File tree

1 file changed

+58
-46
lines changed

1 file changed

+58
-46
lines changed

flake.nix

Lines changed: 58 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@
5656
});
5757
})
5858
];
59-
60-
applyOxcamlPatches = import ./nix/ox-patches.nix {
61-
inherit pkgs;
62-
lib = pkgs.lib;
59+
60+
applyOxcamlPatches = import ./nix/ox-patches.nix {
61+
inherit pkgs;
62+
lib = pkgs.lib;
6363
oxcamlOpamRepo = oxcaml-opam-repository;
6464
};
65-
65+
6666
dune-static-overlay = self: super: {
6767
ocamlPackages = super.ocaml-ng.ocamlPackages_5_3.overrideScope (
6868
oself: osuper: {
@@ -196,20 +196,23 @@
196196
}:
197197
let
198198
hasOcamlOverride = (packageOverrides { } { ocaml = null; }) ? ocaml;
199-
199+
200200
pkgs' =
201201
if hasOcamlOverride then
202202
pkgs.extend (
203203
pself: psuper: {
204204
ocamlPackages = psuper.ocamlPackages.overrideScope (
205205
oself: osuper:
206-
(pkgs.lib.mapAttrs
207-
(name: pkg:
208-
if pkgs.lib.isDerivation pkg && pkg ? overrideAttrs
209-
then pkg.overrideAttrs (old: { doCheck = false; })
210-
else pkg)
211-
osuper)
212-
// (packageOverrides oself osuper)
206+
(pkgs.lib.mapAttrs (
207+
name: pkg:
208+
if pkgs.lib.isDerivation pkg && pkg ? overrideAttrs then
209+
pkg.overrideAttrs (old: {
210+
doCheck = false;
211+
})
212+
else
213+
pkg
214+
) osuper)
215+
// (packageOverrides oself osuper)
213216
);
214217
}
215218
)
@@ -234,35 +237,37 @@
234237
'';
235238

236239
baseInputs = if includeTestDeps then (testNativeBuildInputs pkgs') ++ docInputs else [ ];
237-
238-
ocamlLibs = if includeTestDeps then
239-
(with pkgs'.ocamlPackages; [
240-
ctypes
241-
cinaps
242-
integers
243-
lwt
244-
mdx
245-
menhir
246-
merlin
247-
ocaml-index
248-
ocaml-lsp
249-
odoc
250-
patdiff
251-
ppx_expect
252-
re
253-
spawn
254-
uutf
255-
])
256-
else
257-
[ ];
240+
241+
ocamlLibs =
242+
if includeTestDeps then
243+
(with pkgs'.ocamlPackages; [
244+
ctypes
245+
cinaps
246+
integers
247+
lwt
248+
mdx
249+
menhir
250+
merlin
251+
ocaml-index
252+
ocaml-lsp
253+
odoc
254+
patdiff
255+
ppx_expect
256+
re
257+
spawn
258+
uutf
259+
])
260+
else
261+
[ ];
258262
in
259263

260264
pkgs'.mkShell {
261265
shellHook = ''
262266
export DUNE_SOURCE_ROOT=$PWD
263267
'';
264268
inherit meta;
265-
nativeBuildInputs = baseInputs ++ [ duneScript ] ++ (if hasOcamlOverride then [ pkgs'.ocamlPackages.ocaml ] else [ ]);
269+
nativeBuildInputs =
270+
baseInputs ++ [ duneScript ] ++ (if hasOcamlOverride then [ pkgs'.ocamlPackages.ocaml ] else [ ]);
266271
inputsFrom = if hasOcamlOverride then [ ] else [ pkgs'.ocamlPackages.dune_3 ];
267272
buildInputs =
268273
(if includeTestDeps then testBuildInputs else [ ])
@@ -389,30 +394,37 @@
389394

390395
ox-minimal = makeDuneDevShell {
391396
includeTestDeps = false;
392-
packageOverrides = oself: osuper:
393-
(applyOxcamlPatches oself osuper) // {
397+
packageOverrides =
398+
oself: osuper:
399+
(applyOxcamlPatches oself osuper)
400+
// {
394401
# dune_3 = self.packages.${system}.default;
395402
ocaml = oxcaml.packages.${system}.default.overrideAttrs (old: {
396403
passthru = (old.passthru or { }) // pkgs.ocamlPackages.ocaml.passthru;
397404
meta = (old.meta or { }) // pkgs.ocamlPackages.ocaml.meta;
398405
});
399-
spawn = osuper.spawn.overrideAttrs (old: { doCheck = false; });
406+
spawn = osuper.spawn.overrideAttrs (old: {
407+
doCheck = false;
408+
});
400409
};
401-
extraBuildInputs = pkgs: with pkgs.ocamlPackages; [
402-
re
403-
spawn
404-
uutf
405-
findlib
406-
];
410+
extraBuildInputs =
411+
pkgs: with pkgs.ocamlPackages; [
412+
re
413+
spawn
414+
uutf
415+
findlib
416+
];
407417
meta.description = ''
408418
Provides a minimal shell environment with OxCaml in order to
409419
run the OxCaml tests.
410420
'';
411421
};
412422

413423
ox = makeDuneDevShell {
414-
packageOverrides = oself: osuper:
415-
(applyOxcamlPatches oself osuper) // {
424+
packageOverrides =
425+
oself: osuper:
426+
(applyOxcamlPatches oself osuper)
427+
// {
416428
dune_3 = self.packages.${system}.default;
417429
ocaml = oxcaml.packages.${system}.default.overrideAttrs (old: {
418430
passthru = (old.passthru or { }) // pkgs.ocamlPackages.ocaml.passthru;

0 commit comments

Comments
 (0)