Skip to content

Commit

Permalink
add release shell
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro committed Jun 18, 2024
1 parent 2b49893 commit fa2ba72
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
8 changes: 7 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
rec {
packages = pkgs.callPackage ./nix { nix-filter = nix-filter.lib; };
defaultPackage = packages.httpun-ws;
devShell = pkgs.callPackage ./nix/shell.nix { inherit packages; };
devShells = {
default = pkgs.callPackage ./nix/shell.nix { inherit packages; };
release = pkgs.callPackage ./nix/shell.nix {
inherit packages;
release-mode = true;
};
};
});
}
16 changes: 14 additions & 2 deletions nix/shell.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
{ packages, pkgs, stdenv, lib, mkShell }:
{ packages
, pkgs
, stdenv
, lib
, mkShell
, release-mode ? false
}:

let
httpun-wsDrvs = lib.filterAttrs (_: value: lib.isDerivation value) packages;

in
(mkShell {
inputsFrom = lib.attrValues httpun-wsDrvs;
buildInputs = with pkgs.ocamlPackages; [
buildInputs = with pkgs.ocamlPackages; (if release-mode then
(with pkgs; [
cacert
curl
dune-release
git
]) else [ ]) ++ [
merlin
ocamlformat
httpun-lwt-unix
Expand Down

0 comments on commit fa2ba72

Please sign in to comment.