texlive: move combinePkgs from default.nix to combine.nix

This commit is contained in:
apfelkuchen06 2023-08-21 22:41:53 +02:00
parent 88d154fed5
commit a424dacb8a
2 changed files with 17 additions and 17 deletions

View file

@ -8,6 +8,22 @@ args@{
, ...
}:
let
# combine a set of TL packages into a single TL meta-package
combinePkgs = pkgList: lib.catAttrs "pkg" (
let
# a TeX package is an attribute set { pkgs = [ ... ]; ... } where pkgs is a list of derivations
# the derivations make up the TeX package and optionally (for backward compatibility) its dependencies
tlPkgToSets = { pkgs, ... }: map ({ tlType, version ? "", outputName ? "", ... }@pkg: {
# outputName required to distinguish among bin.core-big outputs
key = "${pkg.pname or pkg.name}.${tlType}-${version}-${outputName}";
inherit pkg;
}) pkgs;
pkgListToSets = lib.concatMap tlPkgToSets; in
builtins.genericClosure {
startSet = pkgListToSets pkgList;
operator = { pkg, ... }: pkgListToSets (pkg.tlDeps or []);
});
pkgSet = removeAttrs args [ "pkgFilter" "extraName" "extraVersion" ];
pkgList = rec {
combined = combinePkgs (lib.attrValues pkgSet);

View file

@ -23,7 +23,7 @@ let
# function for creating a working environment from a set of TL packages
combine = import ./combine.nix {
inherit bin combinePkgs buildEnv lib makeWrapper writeText runCommand
inherit bin buildEnv lib makeWrapper writeText runCommand
stdenv perl libfaketime makeFontsConf bash tl coreutils gawk gnugrep gnused;
ghostscript = ghostscript_headless;
};
@ -492,22 +492,6 @@ let
// lib.optionalAttrs (args ? deps) { deps = map (n: tl.${n}) (args.deps or [ ]); })
) overriddenTlpdb;
# combine a set of TL packages into a single TL meta-package
combinePkgs = pkgList: lib.catAttrs "pkg" (
let
# a TeX package is an attribute set { pkgs = [ ... ]; ... } where pkgs is a list of derivations
# the derivations make up the TeX package and optionally (for backward compatibility) its dependencies
tlPkgToSets = { pkgs, ... }: map ({ tlType, version ? "", outputName ? "", ... }@pkg: {
# outputName required to distinguish among bin.core-big outputs
key = "${pkg.pname or pkg.name}.${tlType}-${version}-${outputName}";
inherit pkg;
}) pkgs;
pkgListToSets = lib.concatMap tlPkgToSets; in
builtins.genericClosure {
startSet = pkgListToSets pkgList;
operator = { pkg, ... }: pkgListToSets (pkg.tlDeps or []);
});
assertions = with lib;
assertMsg (tlpdbVersion.year == version.texliveYear) "TeX Live year in texlive does not match tlpdb.nix, refusing to evaluate" &&
assertMsg (tlpdbVersion.frozen == version.final) "TeX Live final status in texlive does not match tlpdb.nix, refusing to evaluate";