<commit_before>/* Hydra job to build a tarball for Nixpkgs from a Git checkout.  It
   also builds the documentation and tests whether the Nix expressions
   evaluate correctly. */

{ nixpkgs
, officialRelease
, supportedSystems
, pkgs ? import nixpkgs.outPath {}
, nix ? pkgs.nix
, lib-tests ? import ../../lib/tests/release.nix { inherit pkgs; }
}:

pkgs.releaseTools.sourceTarball {
  name = "nixpkgs-tarball";
  src = nixpkgs;

  inherit officialRelease;
  version = pkgs.lib.fileContents ../../.version;
  versionSuffix = "pre${
    if nixpkgs ? lastModified
    then builtins.substring 0 8 (nixpkgs.lastModifiedDate or nixpkgs.lastModified)
    else toString nixpkgs.revCount}.${nixpkgs.shortRev or "dirty"}";

  buildInputs = with pkgs; [ nix.out jq lib-tests pkgs.brotli ];

  configurePhase = ''
    eval "$preConfigure"
    releaseName=nixpkgs-$VERSION$VERSION_SUFFIX
    echo -n $VERSION_SUFFIX > .version-suffix
    echo -n ${nixpkgs.rev or nixpkgs.shortRev or "dirty"} > .git-revision
    echo "release name is $releaseName"
    echo "git-revision is $(cat .git-revision)"
  '';

  nixpkgs-basic-release-checks = import ./nixpkgs-basic-release-checks.nix
   { inherit nix pkgs nixpkgs supportedSystems; };

  dontBuild = false;
<commit_msg>Update pkgs/top-level/make-tarball.nix<commit_after>/* Hydra job to build a tarball for Nixpkgs from a Git checkout.  It
   also builds the documentation and tests whether the Nix expressions
   evaluate correctly. */

{ nixpkgs
, officialRelease
, supportedSystems
, pkgs ? import nixpkgs.outPath {}
, nix ? pkgs.nix
, lib-tests ? import ../../lib/tests/release.nix { inherit pkgs; }
}:

pkgs.releaseTools.sourceTarball {
  name = "nixpkgs-tarball";
  src = nixpkgs;

  inherit officialRelease;
  version = pkgs.lib.fileContents ../../.version;
  versionSuffix = "pre${
    if nixpkgs ? lastModified
    then builtins.substring 0 8 (nixpkgs.lastModifiedDate or nixpkgs.lastModified)
    else toString nixpkgs.revCount}.${nixpkgs.shortRev or "dirty"}";

  buildInputs = with pkgs; [ nix.out jq lib-tests brotli ];

  configurePhase = ''
    eval "$preConfigure"
    releaseName=nixpkgs-$VERSION$VERSION_SUFFIX
    echo -n $VERSION_SUFFIX > .version-suffix
    echo -n ${nixpkgs.rev or nixpkgs.shortRev or "dirty"} > .git-revision
    echo "release name is $releaseName"
    echo "git-revision is $(cat .git-revision)"
  '';

  nixpkgs-basic-release-checks = import ./nixpkgs-basic-release-checks.nix
   { inherit nix pkgs nixpkgs supportedSystems; };

  dontBuild = false;

{'fraction_non_alphanumeric': 0.11559778305621536, 'fraction_numerical': 0.001583531274742676, 'mean_word_length': 3.5945454545454547, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4376728', 'n_tokens_mistral': 906, 'n_tokens_neox': 850, 'n_words': 219}