diff --git a/modules/hooks.nix b/modules/hooks.nix index 63bcc1cb..cc3d639f 100644 --- a/modules/hooks.nix +++ b/modules/hooks.nix @@ -22,6 +22,20 @@ let if hook.settings.binPath == null then "${hook.package}${binPath}" else hook.settings.binPath; + + texliveCombine = pkgs.texlive.combine ( + lib.mergeAttrsList + ( + map + (package: { ${package} = pkgs.texlive.${package}; }) + ( + builtins.filter + (hook: hooks.${hook}.enable) + [ "chktex" "lacheck" "latexindent" ] + ) + ) + // { inherit (pkgs.texlive) scheme-minimal; } + ); in { imports = @@ -2228,7 +2242,7 @@ in name = "chktex"; description = "LaTeX semantic checker"; types = [ "file" "tex" ]; - package = tools.chktex; + package = texliveCombine; entry = "${hooks.chktex.package}/bin/chktex"; }; clang-format = @@ -2903,7 +2917,7 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol name = "latexindent"; description = "Perl script to add indentation to LaTeX files."; types = [ "file" "tex" ]; - package = tools.latexindent; + package = texliveCombine; entry = "${hooks.latexindent.package}/bin/latexindent ${hooks.latexindent.settings.flags}"; }; lacheck = @@ -2918,7 +2932,7 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol name = "lacheck"; description = "A consistency checker for LaTeX documents."; types = [ "file" "tex" ]; - package = tools.lacheck; + package = texliveCombine; entry = "${script}"; }; lua-ls = diff --git a/nix/tools.nix b/nix/tools.nix index c509f8d3..2ed61d9d 100644 --- a/nix/tools.nix +++ b/nix/tools.nix @@ -91,11 +91,6 @@ }: -let - tex = texlive.combine { - inherit (texlive) latexindent chktex scheme-basic; - }; -in { clang-tools = llvmPackages_latest.clang-tools; inherit @@ -191,11 +186,6 @@ in tflint = callPackage ./tflint { }; dune-build-opam-files = callPackage ./dune-build-opam-files { dune = dune_3; inherit (pkgsBuildBuild) ocaml; }; dune-fmt = callPackage ./dune-fmt { dune = dune_3; inherit (pkgsBuildBuild) ocaml; }; - latexindent = tex; - lacheck = texlive.combine { - inherit (texlive) lacheck scheme-basic; - }; - chktex = tex; commitizen = commitizen.overrideAttrs (_: _: { doCheck = false; }); bats = if bats ? withLibraries then (bats.withLibraries (p: [ p.bats-support p.bats-assert p.bats-file ])) else bats; git-annex = if stdenv.isDarwin then null else git-annex;