-
Notifications
You must be signed in to change notification settings - Fork 3
/
shell.nix
25 lines (23 loc) · 840 Bytes
/
shell.nix
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
let
pkgs = import ./nix/sources.nix { };
inherit (pkgs) lib;
reenvPkgs = pkgs.recurseIntoAttrs (import ./nix { inherit pkgs; }).native;
reenvDrvs = lib.filterAttrs (_: value: lib.isDerivation value) reenvPkgs;
filterDrvs = inputs:
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 || name == drv.name) (lib.attrNames reenvDrvs)))
inputs;
in
with pkgs;
(mkShell {
inputsFrom = lib.attrValues reenvDrvs;
buildInputs = with ocamlPackages; [ merlin ocamlformat utop ocaml-lsp ];
}).overrideAttrs (o: {
propagatedBuildInputs = filterDrvs o.propagatedBuildInputs;
buildInputs = filterDrvs o.buildInputs;
})