<commit_before># Evaluate `release.nix' like Hydra would.  Too bad nix-instantiate
# can't to do this.

with import ../../pkgs/lib;

let
  trace = if builtins.getEnv "VERBOSE" == "1" then builtins.trace else (x: y: y);

  rel = removeAttrs (import ../../pkgs/top-level/release.nix { }) [ "tarball" "unstable" "xbursttools" ];

  # Add the ‘recurseForDerivations’ attribute to ensure that
  # nix-instantiate recurses into nested attribute sets.
  recurse = attrs:
    if (builtins.tryEval attrs).success then
      if isDerivation attrs 
      then
        if (builtins.tryEval attrs.outPath).success
        then attrs
        else { }
      else { recurseForDerivations = true; } // mapAttrs (n: v: recurse v) attrs
    else { };

in recurse rel<commit_msg>Make eval-release.nix less picky<commit_after># Evaluate `release.nix' like Hydra would.  Too bad nix-instantiate
# can't to do this.

with import ../../pkgs/lib;

let
  trace = if builtins.getEnv "VERBOSE" == "1" then builtins.trace else (x: y: y);

  rel = removeAttrs (import ../../pkgs/top-level/release.nix { }) [ "tarball" "unstable" "xbursttools" ];

  # Add the ‘recurseForDerivations’ attribute to ensure that
  # nix-instantiate recurses into nested attribute sets.
  recurse = path: attrs:
    if (builtins.tryEval attrs).success then
      if isDerivation attrs
      then
        if (builtins.tryEval attrs.drvPath).success
        then { inherit (attrs) name drvPath; }
        else { failed = true; }
      else { recurseForDerivations = true; } //
           mapAttrs (n: v: let path' = path ++ [n]; in trace path' (recurse path' v)) attrs
    else { };

in recurse [] rel
{'fraction_non_alphanumeric': 0.12325440194292653, 'fraction_numerical': 0.0012143290831815423, 'mean_word_length': 2.8867924528301887, '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': '4652249', 'n_tokens_mistral': 561, 'n_tokens_neox': 545, 'n_words': 170}