-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(nix): switch to flakes and nixpkgs
Signed-off-by: Rudi Grinberg <[email protected]> <!-- ps-id: ddd142a5-32dd-497e-b9c4-2e6c9fb55e32 -->
- Loading branch information
Showing
7 changed files
with
211 additions
and
3,963 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
{ | ||
description = "Cohttp Nix Flake"; | ||
|
||
inputs.nix-filter.url = "github:numtide/nix-filter"; | ||
inputs.flake-utils.url = "github:numtide/flake-utils"; | ||
inputs.nixpkgs.url = "github:nixos/nixpkgs"; | ||
|
||
outputs = { self, nixpkgs, flake-utils, nix-filter }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
# pkgs = nixpkgs.legacyPackages."${system}"; | ||
pkgs = (import nixpkgs { | ||
inherit system; | ||
overlays = [ | ||
(final: prev: { | ||
ocamlPackages = prev.ocamlPackages.overrideScope' (oself: osuper: { | ||
ctypes-foreign = osuper.ctypes-foreign.overrideAttrs (_: { doCheck = false; }); | ||
ctypes = osuper.ctypes.overrideAttrs (_: { doCheck = false; }); | ||
mdx = osuper.mdx.override { | ||
# workaround for: | ||
# https://github.com/NixOS/nixpkgs/pull/241476/commits/1ed74f3536d29e5635d7f47a1d7b82a89f5a8077 | ||
logs = oself.logs; | ||
}; | ||
}); | ||
}) | ||
]; | ||
}); | ||
inherit (pkgs.ocamlPackages) buildDunePackage; | ||
pkg = attrs: buildDunePackage ({ | ||
version = "n/a"; | ||
src = ./. ; | ||
duneVersion = "3"; | ||
doCheck = true; | ||
} // attrs); | ||
overlay = final: prev: { | ||
}; | ||
in | ||
with pkgs.ocamlPackages; rec { | ||
packages = rec { | ||
default = http; | ||
http = pkg { | ||
pname = "http"; | ||
checkInputs = [ alcotest base_quickcheck ppx_expect crowbar ]; | ||
}; | ||
cohttp = pkg { | ||
pname = "cohttp"; | ||
checkInputs = [ fmt alcotest ]; | ||
propagatedBuildInputs = [ | ||
stringext http re uri uri-sexp logs sexplib0 ppx_sexp_conv | ||
]; | ||
}; | ||
cohttp-top = pkg { | ||
pname = "cohttp-top"; | ||
propagatedBuildInputs = [ cohttp ]; | ||
}; | ||
cohttp-curl = pkg { | ||
pname = "cohttp-curl"; | ||
propagatedBuildInputs = [ ocurl http stringext ]; | ||
}; | ||
cohttp-curl-lwt = pkg { | ||
pname = "cohttp-curl-lwt"; | ||
checkInputs = [ cohttp-lwt-unix cohttp cohttp-lwt conduit-lwt ounit uri ]; | ||
propagatedBuildInputs = [ ocurl http stringext lwt ]; | ||
}; | ||
cohttp-curl-async = pkg { | ||
pname = "cohttp-curl-async"; | ||
checkInputs = [ | ||
uri fmt ounit alcotest | ||
# cohttp-async | ||
]; | ||
propagatedBuildInputs = [ | ||
ocurl http stringext cohttp-curl core core_unix | ||
async_kernel async_unix | ||
]; | ||
}; | ||
cohttp-lwt = pkg { | ||
pname = "cohttp-lwt"; | ||
propagatedBuildInputs = [ http cohttp lwt sexplib0 ppx_sexp_conv logs uri ]; | ||
}; | ||
cohttp-lwt-jsoo = pkg { | ||
pname = "cohttp-lwt-jsoo"; | ||
propagatedBuildInputs = [ | ||
http cohttp cohttp-lwt logs lwt js_of_ocaml | ||
js_of_ocaml-ppx js_of_ocaml-lwt | ||
]; | ||
}; | ||
cohttp-async = pkg { | ||
pname = "cohttp-async"; | ||
checkInputs = [ mirage-crypto ounit ]; | ||
propagatedBuildInputs = [ http cohttp async_kernel async_unix async base | ||
core core_unix conduit-async magic-mime logs fmt sexplib0 ppx_sexp_conv | ||
uri uri-sexp ipaddr | ||
]; | ||
}; | ||
cohttp-lwt-unix = pkg { | ||
pname = "cohttp-lwt-unix"; | ||
checkInputs = [ ounit ]; | ||
propagatedBuildInputs = [ | ||
http cohttp cohttp-lwt cmdliner lwt conduit-lwt | ||
conduit-lwt-unix fmt ppx_sexp_conv magic-mime logs | ||
]; | ||
}; | ||
cohttp-server-lwt-unix = pkg { | ||
pname = "cohttp-server-lwt-unix"; | ||
checkInputs = [ conduit-lwt-unix cohttp-lwt cohttp-lwt-unix ]; | ||
propagatedBuildInputs = [ http lwt ]; | ||
}; | ||
cohttp-eio = pkg { | ||
pname = "cohttp-eio"; | ||
checkInputs = [ alcotest eio_main mdx ppx_here | ||
# tls-eio | ||
# mirage-crypto-rng-eio | ||
]; | ||
propagatedBuildInputs = [ cohttp eio eio_main logs uri fmt ptime http ]; | ||
}; | ||
cohttp-mirage = pkg { | ||
pname = "cohttp-mirage"; | ||
propagatedBuildInputs = [ | ||
mirage-flow mirage-channel conduit conduit-mirage | ||
mirage-kv lwt cohttp-lwt cstruct fmt astring magic-mime ppx_sexp_conv | ||
]; | ||
}; | ||
cohttp-bench = pkg { | ||
pname = "cohttp-bench"; | ||
buildInputs = [ core core_bench eio http cohttp cohttp-eio | ||
cohttp-lwt-unix cohttp-server-lwt-unix # cohttp-async | ||
]; | ||
}; | ||
}; | ||
devShells.default = pkgs.mkShell { | ||
inputsFrom = pkgs.lib.attrValues packages; | ||
buildInputs = with pkgs.ocamlPackages; [ ocaml-lsp pkgs.ocamlformat ]; | ||
}; | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.