on iko/ghcjs-patch-master help sign in
Support `tool "cabal-install" "3.2.0.0"` (#704)

Currently only `tool "cabal" "3.2.0.0"` works.

commitd7b6258c0d1a0e94faf98f40f055b806ba84aa43 authorHamish Mackenzie <Hamish.Mackenzie@iohk.io> dateFri 19 Jun 2020, 13:20 (6 years ago) parente1b8720
1 file changed+12−3
overlays/tools.nix+12−3
overlays/tools.nix+12−3
@@ -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