<commit_before>{ stdenv, fetchurl, runCommand, python, perl, cdrkit, pathsFromGraph }:

{ packages ? []
, mirror ? "http://ftp.gwdg.de/pub/linux/sources.redhat.com/cygwin"
, extraContents ? []
}:

let
  cygPkgList = if stdenv.is64bit then fetchurl {
    url = "${mirror}/x86_64/setup.ini";
    sha256 = "142f8zyfwgi6s2djxv3z5wn0ysl94pxwa79z8rjfqz4kvnpgz120";
  } else fetchurl {
    url = "${mirror}/x86/setup.ini";
    sha256 = "1v596lln2iip5h7wxjnig5rflzvqa21zzd2iyhx07zs28q5h76i9";
  };

  cygwinCross = (import ../../../../top-level/all-packages.nix {
    inherit (stdenv) system;
    crossSystem = {
      libc = "msvcrt";
      platform = {};
      openssl.system = "mingw64";
    } // (if stdenv.is64bit then {
      config = "x86_64-w64-mingw32";
      arch = "x86_64";
    } else {
      config = "i686-w64-mingw32";
      arch = "i686";
    });
  }).windows.cygwinSetup.crossDrv;

  makeCygwinClosure = { packages, packageList }: let
    expr = import (runCommand "cygwin.nix" { buildInputs = [ python ]; } ''
      python ${./mkclosure.py} "${packages}" ${toString packageList} > "$out"
    '');
    gen = { url, md5 }: {
      source = fetchurl {
        url = "${mirror}/${url}";
        inherit md5;
      };
      target = url;
    };
  in map gen expr;

in import <nixpkgs/nixos/lib/make-iso9660-image.nix> {
  inherit stdenv perl cdrkit pathsFromGraph;
  contents = [
    { source = "${cygwinCross}/bin/setup.exe";
      target = "setup.exe";
    }
    { source = cygPkgList;
      target = "setup.ini";
    }
  ] ++ makeCygwinClosure {
    packages = cygPkgList;
    packageList = packages;
  } ++ extraContents;
}
<commit_msg>vm/windows: Update SHAs for Cygwin setup.ini.<commit_after>{ stdenv, fetchurl, runCommand, python, perl, cdrkit, pathsFromGraph }:

{ packages ? []
, mirror ? "http://ftp.gwdg.de/pub/linux/sources.redhat.com/cygwin"
, extraContents ? []
}:

let
  cygPkgList = if stdenv.is64bit then fetchurl {
    url = "${mirror}/x86_64/setup.ini";
    sha256 = "0ljsxdkx9s916wp28kcvql3bjx80zzzidan6jicby7i9s3sm96n9";
  } else fetchurl {
    url = "${mirror}/x86/setup.ini";
    sha256 = "1slyj4qha7x649ggwdski9spmyrbs04z2d46vgk8krllg0kppnjv";
  };

  cygwinCross = (import ../../../../top-level/all-packages.nix {
    inherit (stdenv) system;
    crossSystem = {
      libc = "msvcrt";
      platform = {};
      openssl.system = "mingw64";
    } // (if stdenv.is64bit then {
      config = "x86_64-w64-mingw32";
      arch = "x86_64";
    } else {
      config = "i686-w64-mingw32";
      arch = "i686";
    });
  }).windows.cygwinSetup.crossDrv;

  makeCygwinClosure = { packages, packageList }: let
    expr = import (runCommand "cygwin.nix" { buildInputs = [ python ]; } ''
      python ${./mkclosure.py} "${packages}" ${toString packageList} > "$out"
    '');
    gen = { url, md5 }: {
      source = fetchurl {
        url = "${mirror}/${url}";
        inherit md5;
      };
      target = url;
    };
  in map gen expr;

in import <nixpkgs/nixos/lib/make-iso9660-image.nix> {
  inherit stdenv perl cdrkit pathsFromGraph;
  contents = [
    { source = "${cygwinCross}/bin/setup.exe";
      target = "setup.exe";
    }
    { source = cygPkgList;
      target = "setup.ini";
    }
  ] ++ makeCygwinClosure {
    packages = cygPkgList;
    packageList = packages;
  } ++ extraContents;
}

{'fraction_non_alphanumeric': 0.16014449127031907, 'fraction_numerical': 0.048163756773028296, 'mean_word_length': 2.721164613661814, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5826234', 'n_tokens_mistral': 1382, 'n_tokens_neox': 1282, 'n_words': 219}