<commit_before># this is an utility for mergeing shells created with mkShell
# TODO: make this an attribute of mkShell result set.
{ lib }:

super: shells: super.overrideAttrs(super: with lib; {
  inputsFrom = (super.inputsFrom or []) ++ unique (catAttrs "inputsFrom" shells);
  buildInputs = (super.buildInputs or []) ++ unique (catAttrs "buildInputs" shells);
  shellHook = (super.shellHook or "") + concatStrings (catAttrs "shellHook" shells);
})<commit_msg>nix: add support for more build inputs in mergeSh<commit_after># 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);
  })
{'fraction_non_alphanumeric': 0.09577677224736049, 'fraction_numerical': 0.0, 'mean_word_length': 4.871681415929204, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3581784', 'n_tokens_mistral': 396, 'n_tokens_neox': 393, 'n_words': 130}