@@ -2,7 +2,8 @@
22# Typically we want to make these available in a nix-shell
33# created with shellFor. In most cases the package name
44# will be the same as the executable, but we have a
5−# `toolPackageName` mapping to help when it is not.
5+# `toolPackageName` and `packageToolName` mapping to help
6+# when it is not.
67#
78# To get a single tool:
89# haskell-nix.tool "cabal" "3.2.0.0"
@@ -38,14 +39,22 @@ let
3839in { haskell-nix = prev.haskell-nix // {
3940
4041 # Some times the package name in hackage is not the same as tool name.
42+ # Tools better known by their exe name.
4143 toolPackageName = {
4244 cabal = "cabal-install";
4345 };
4446
47+ # Packages that are better known by their package name. We are not
48+ # reusing toolPackageName here as perhaps the more one package
49+ # will have the same exe name.
50+ packageToolName = {
51+ cabal-install = "cabal";
52+ };
53+
4554 hackage-tool = { name, ... }@args:
4655 (final.haskell-nix.hackage-package
47− (args // { name = final.haskell-nix.toolPackageName."${name}" or name; }))
48− .components.exes."${name}";
56+ (args // { name = final.haskell-nix.toolPackageName.${name} or name; }))
57+ .components.exes."${final.haskell-nix.packageToolName.${name} or name}";
4958
5059 tool = name: versionOrArgs:
5160 let