nix: add support for more build inputs in mergeSh
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
73a8992db7
commit
64b8b9f170
|
@ -1,9 +1,20 @@
|
|||
# this is an utility for mergeing shells created with mkShell
|
||||
# TODO: make this an attribute of mkShell result set.
|
||||
# TODO: make this an attribute of mkShell result set. Or just use inputsFrom.
|
||||
{ lib }:
|
||||
|
||||
super: shells: super.overrideAttrs(super: with lib; {
|
||||
inputsFrom = (super.inputsFrom or []) ++ unique (catAttrs "inputsFrom" shells);
|
||||
buildInputs = (super.buildInputs or []) ++ unique (catAttrs "buildInputs" shells);
|
||||
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);
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue