From fa2ba7273de3d270f07f773b397da184de6bafdd Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Mon, 17 Jun 2024 22:38:48 -0700 Subject: [PATCH] add release shell --- flake.nix | 8 +++++++- nix/shell.nix | 16 ++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 48bbf10b..13c02d49 100644 --- a/flake.nix +++ b/flake.nix @@ -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; + }; + }; }); } diff --git a/nix/shell.nix b/nix/shell.nix index a768ad95..a55bd4fb 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -1,4 +1,10 @@ -{ packages, pkgs, stdenv, lib, mkShell }: +{ packages +, pkgs +, stdenv +, lib +, mkShell +, release-mode ? false +}: let httpun-wsDrvs = lib.filterAttrs (_: value: lib.isDerivation value) packages; @@ -6,7 +12,13 @@ let 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