texlive: move fastUnique from default.nix to combine.nix
This commit is contained in:
parent
fdfcc4c292
commit
a1505f3c6a
@ -31,6 +31,12 @@ let
|
|||||||
++ lib.optional (lib.any pkgNeedsRuby splitBin.wrong) ruby;
|
++ lib.optional (lib.any pkgNeedsRuby splitBin.wrong) ruby;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# TODO: replace by buitin once it exists
|
||||||
|
fastUnique = comparator: list: with lib;
|
||||||
|
let un_adj = l: if length l < 2 then l
|
||||||
|
else optional (head l != elemAt l 1) (head l) ++ un_adj (tail l);
|
||||||
|
in un_adj (lib.sort comparator list);
|
||||||
|
|
||||||
mkUniquePkgs = pkgs: fastUnique (a: b: a < b) # highlighting hack: >
|
mkUniquePkgs = pkgs: fastUnique (a: b: a < b) # highlighting hack: >
|
||||||
# here we deal with those dummy packages needed for hyphenation filtering
|
# here we deal with those dummy packages needed for hyphenation filtering
|
||||||
(map (p: if lib.isDerivation p then p.outPath else "") pkgs);
|
(map (p: if lib.isDerivation p then p.outPath else "") pkgs);
|
||||||
|
@ -24,7 +24,7 @@ let
|
|||||||
|
|
||||||
# function for creating a working environment from a set of TL packages
|
# function for creating a working environment from a set of TL packages
|
||||||
combine = import ./combine.nix {
|
combine = import ./combine.nix {
|
||||||
inherit bin combinePkgs buildEnv fastUnique lib makeWrapper writeText
|
inherit bin combinePkgs buildEnv lib makeWrapper writeText
|
||||||
stdenv python ruby perl;
|
stdenv python ruby perl;
|
||||||
ghostscript = ghostscriptX; # could be without X, probably, but we use X above
|
ghostscript = ghostscriptX; # could be without X, probably, but we use X above
|
||||||
};
|
};
|
||||||
@ -171,12 +171,6 @@ let
|
|||||||
combinePkgs = pkgSet: lib.concatLists # uniqueness is handled in `combine`
|
combinePkgs = pkgSet: lib.concatLists # uniqueness is handled in `combine`
|
||||||
(lib.mapAttrsToList (_n: a: a.pkgs) pkgSet);
|
(lib.mapAttrsToList (_n: a: a.pkgs) pkgSet);
|
||||||
|
|
||||||
# TODO: replace by buitin once it exists
|
|
||||||
fastUnique = comparator: list: with lib;
|
|
||||||
let un_adj = l: if length l < 2 then l
|
|
||||||
else optional (head l != elemAt l 1) (head l) ++ un_adj (tail l);
|
|
||||||
in un_adj (lib.sort comparator list);
|
|
||||||
|
|
||||||
in
|
in
|
||||||
tl // {
|
tl // {
|
||||||
inherit bin combine;
|
inherit bin combine;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user