Skip to content

Commit

Permalink
texlive: avoid top-level with in pkgs/tools/typesetting/tex/texlive…
Browse files Browse the repository at this point in the history
…/generate-fixed-hashes.nix
  • Loading branch information
philiptaron committed Apr 29, 2024
1 parent aa30bcc commit 0305d5e
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions pkgs/tools/typesetting/tex/texlive/generate-fixed-hashes.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
with import ../../../../.. { };
{ pkgs ? (import ../../../../.. { }) }:

with lib; let
getFods = drv: lib.optional (isDerivation drv.tex) (drv.tex // { tlType = "run"; })
++ lib.optional (drv ? texdoc) (drv.texdoc // { tlType = "doc"; })
++ lib.optional (drv ? texsource) (drv.texsource // { tlType = "source"; })
++ lib.optional (drv ? tlpkg) (drv.tlpkg // { tlType = "tlpkg"; });
let
inherit (pkgs) runCommand writeText texlive nix;
inherit (pkgs.lib)
attrValues
concatMap
concatMapStrings
isDerivation
filter
optional
optionalString
sort
strings
;

getFods = drv: optional (isDerivation drv.tex) (drv.tex // { tlType = "run"; })
++ optional (drv ? texdoc) (drv.texdoc // { tlType = "doc"; })
++ optional (drv ? texsource) (drv.texsource // { tlType = "source"; })
++ optional (drv ? tlpkg) (drv.tlpkg // { tlType = "tlpkg"; });

sorted = sort (a: b: a.pname < b.pname) (attrValues texlive.pkgs);
fods = concatMap getFods sorted;
Expand Down

0 comments on commit 0305d5e

Please sign in to comment.