<commit_before>let

  allPackages = import ./all-packages.nix;

  pkgs = allPackages {};

  testOn = systems: f: {system ? builtins.currentSystem}:
    if pkgs.lib.elem system systems then f (allPackages {inherit system;}) else {};
        
  testOnLinux = testOn ["i686-linux" "x86_64-linux"];

  test = testOn ["i686-linux" "x86_64-linux" "i686-darwin" "i686-cygwin"];

in {

  tarball = import ./make-tarball.nix;

  /* All the top-level packages that we want to build in the build
     farm.  The notation is still kinda clumsy.  We could use some
     meta-programming.  E.g. we would want to write
  
       wine = ["i686-linux"];

     which would be translated to

       wine = testOn ["i686-linux"] (pkgs: pkgs.wine);

     Shouldn't be too hard to make a function that recurses over the
     attrset and does this for every attribute. */

  MPlayer = testOnLinux (pkgs: pkgs.MPlayer);
  autoconf = test (pkgs: pkgs.autoconf);
  bash = test (pkgs: pkgs.bash);
  firefox3 = testOnLinux (pkgs: pkgs.firefox3);
  gcc = test (pkgs: pkgs.gcc);
  hello = test (pkgs: pkgs.hello);
  libsmbios = testOnLinux (pkgs: pkgs.libsmbios);
  libtool = test (pkgs: pkgs.libtool);
  pan = testOnLinux (pkgs: pkgs.pan);
  perl = test (pkgs: pkgs.perl);
  python = test (pkgs: pkgs.python);
  thunderbird = testOnLinux (pkgs: pkgs.thunderbird);
  wine = testOn ["i686-linux"] (pkgs: pkgs.wine);

  xorg = {
    libX11 = testOnLinux (pkgs: pkgs.xorg.libX11);    
  };

  kde42 = {
    kdeadmin = testOnLinux (pkgs: pkgs.kde42.kdeadmin);
    kdeartwork = testOnLinux (pkgs: pkgs.kde42.kdeartwork);
    kdebase = testOnLinux (pkgs: pkgs.kde42.kdebase);
    kdebase_runtime = testOnLinux (pkgs: pkgs.kde42.kdebase_runtime);
    kdebase_workspace = testOnLinux (pkgs: pkgs.kde42.kdebase_workspace);
    kdeedu = testOnLinux (pkgs: pkgs.kde42.kdeedu);
    kdegames = testOnLinux (pkgs: pkgs.kde42.kdegames);
    kdegraphics = testOnLinux (pkgs: pkgs.kde42.kdegraphics);
    kdelibs = testOnLinux (pkgs: pkgs.kde42.kdelibs);
    kdemultimedia = testOnLinux (pkgs: pkgs.kde42.kdemultimedia);
    kdenetwork = testOnLinux (pkgs: pkgs.kde42.kdenetwork);
    kdepim = testOnLinux (pkgs: pkgs.kde42.kdepim);
    kdeplasma_addons = testOnLinux (pkgs: pkgs.kde42.kdeplasma_addons);
    kdesdk = testOnLinux (pkgs: pkgs.kde42.kdesdk);
    kdetoys = testOnLinux (pkgs: pkgs.kde42.kdetoys);
    kdeutils = testOnLinux (pkgs: pkgs.kde42.kdeutils);
    kdewebdev = testOnLinux (pkgs: pkgs.kde42.kdewebdev);
  };

  kernelPackages_2_6_27 = {
    aufs = testOnLinux (pkgs: pkgs.kernelPackages_2_6_27.aufs);
    kernel = testOnLinux (pkgs: pkgs.kernelPackages_2_6_27.kernel);
  };
  
  kernelPackages_2_6_28 = {
    aufs = testOnLinux (pkgs: pkgs.kernelPackages_2_6_28.aufs);
    kernel = testOnLinux (pkgs: pkgs.kernelPackages_2_6_28.kernel);
  };
  
}<commit_msg>* Nicer notation for Nixpkgs' Hydra jobs.  The packages to build are   given as a nested attribute set isomorphic to all-packages.nix,   where the value for each attribute is a list of platforms on which   to build the package.  For instance,<commit_after>let

  allPackages = import ./all-packages.nix;

  pkgs = allPackages {};

  /* Perform a job on the given set of platforms.  The function `f' is
     called by Hydra for each platform, and should return some job
     to build on that platform.  `f' is passed the Nixpkgs collection
     for the platform in question. */
  testOn = systems: f: {system ? builtins.currentSystem}:
    if pkgs.lib.elem system systems then f (allPackages {inherit system;}) else {};

  /* Map an attribute of the form `foo = [platforms...]'  to `testOn
     [platforms...] (pkgs: pkgs.foo)'. */
  mapTestOn = pkgs.lib.mapAttrsRecursive
    (path: value: testOn value (pkgs: pkgs.lib.getAttrFromPath path pkgs));

  /* Common platform groups on which to test packages. */
  all = ["i686-linux" "x86_64-linux" "i686-darwin" "i686-cygwin"];
  linux = ["i686-linux" "x86_64-linux"];

in {

  tarball = import ./make-tarball.nix;

} // mapTestOn {

  MPlayer = linux;
  apacheHttpd = linux;
  autoconf = all;
  bash = all;
  firefox3 = linux;
  gcc = all;
  hello = all;
  libsmbios = linux;
  libtool = all;
  pan = linux;
  perl = all;
  python = all;
  thunderbird = linux;
  vlc = linux;
  wine = ["i686-linux"];

  kde42 = {
    kdeadmin = linux;
    kdeartwork = linux;
    kdebase = linux;
    kdebase_runtime = linux;
    kdebase_workspace = linux;
    kdeedu = linux;
    kdegames = linux;
    kdegraphics = linux;
    kdelibs = linux;
    kdemultimedia = linux;
    kdenetwork = linux;
    kdepim = linux;
    kdeplasma_addons = linux;
    kdesdk = linux;
    kdetoys = linux;
    kdeutils = linux;
    kdewebdev = linux;
  };

  kernelPackages_2_6_27 = {
    aufs = linux;
    kernel = linux;
  };
  
  kernelPackages_2_6_28 = {
    aufs = linux;
    kernel = linux;
  };
  
  xorg = {
    libX11 = linux;
  };

}
{'fraction_non_alphanumeric': 0.11763502454991817, 'fraction_numerical': 0.026800327332242226, 'mean_word_length': 3.192967409948542, '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': '5907785', 'n_tokens_mistral': 2052, 'n_tokens_neox': 1834, 'n_words': 463}