about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorPol Dellaiera <pol.dellaiera@protonmail.com>2024-05-01 23:10:59 +0200
committerGitHub <noreply@github.com>2024-05-01 23:10:59 +0200
commit6a72138d190e558b201e7ceea599f05bf89df98c (patch)
tree1ade6741bcf300eeeb26b9da64cc336f4797f5b7 /pkgs
parent95ac5ac25c50df186db9aa6a1748a5ff615176bd (diff)
parent0305d5e8e4d1a025780c828763a46e8bafbaefed (diff)
Merge pull request #307828 from philiptaron/issue-208242/texlive
texlive: avoid top-level `with` in helper script
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/typesetting/tex/texlive/generate-fixed-hashes.nix25
1 files changed, 19 insertions, 6 deletions
diff --git a/pkgs/tools/typesetting/tex/texlive/generate-fixed-hashes.nix b/pkgs/tools/typesetting/tex/texlive/generate-fixed-hashes.nix
index 532e3c5cfafdd..0cff459bc620b 100644
--- a/pkgs/tools/typesetting/tex/texlive/generate-fixed-hashes.nix
+++ b/pkgs/tools/typesetting/tex/texlive/generate-fixed-hashes.nix
@@ -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;