2
0
mirror of https://github.com/status-im/status-react.git synced 2025-01-28 11:45:45 +00:00
Jakub Sokołowski 64b8b9f170
nix: add support for more build inputs in mergeSh
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-05-15 16:19:27 +02:00

21 lines
803 B
Nix

# this is an utility for mergeing shells created with mkShell
# TODO: make this an attribute of mkShell result set. Or just use inputsFrom.
{ lib }:
super: shells:
super.overrideAttrs (super:
let
inherit (lib) attrByPath unique catAttrs concatStrings;
mergeAttrsFor = attrName:
(attrByPath [attrName] [] super) ++ unique (catAttrs attrName shells);
in {
inputsFrom = mergeAttrsFor "inputsFrom";
buildInputs = mergeAttrsFor "buildInputs";
nativeBuildInputs = mergeAttrsFor "nativeBuildInputs";
propagatedBuildInputs = mergeAttrsFor "propagatedBuildInputs";
propagatedNativeBuildInputs = mergeAttrsFor "propagatedNativeBuildInputs";
# shellHook is a string, not a list
shellHook = (super.shellHook or "") + concatStrings (catAttrs "shellHook" shells);
})