-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathshell.nix
More file actions
27 lines (25 loc) · 777 Bytes
/
shell.nix
File metadata and controls
27 lines (25 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{ packages, pkgs, release-mode ? false }:
let
inherit (pkgs) stdenv lib;
lambdaDrvs = lib.filterAttrs (_: value: lib.isDerivation value) packages;
in
(pkgs.mkShell {
inputsFrom = lib.attrValues lambdaDrvs;
buildInputs = (if release-mode then
(with pkgs; [
cacert
curl
ocamlPackages.dune-release
git
opam
]) else [ ]) ++ (with pkgs.ocamlPackages; [ merlin ocamlformat ]);
}).overrideAttrs (o: {
propagatedBuildInputs = lib.filter
(drv:
# we wanna filter our own packages so we don't build them when entering
# the shell. They always have `pname`
!(lib.hasAttr "pname" drv) ||
drv.pname == null ||
!(lib.any (name: name == drv.pname) (lib.attrNames lambdaDrvs)))
o.propagatedBuildInputs;
})