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