Commit Graph
9 Commits
Author SHA1 Message Date
Hamish Mackenzie 5ebce0eb3c Make it easier to access executable components (#565)
This overlay helps accessing common executable components.
Typically we want to make these available in a nix-shell
created with shellFor.  In most cases the package name
will be the same as the executable, but we have a
`toolPackageName` mapping to help when it is not.

```
# To get a single tool:
haskell-nix.tool "cabal" "3.2.0.0"

# This does the same thing as:
(haskell-nix.hackage-package {
  name = "cabal-install"
  version = "3.2.0.0"
}).components.exes.cabal

# To get an attr set containing multiple tools:
haskell-nix.tools { cabal = "3.2.0.0"; hlint = "2.2.11"; }

# To add tools to a shell:
shellFor { tools = { cabal = "3.2.0.0"; hlint = "2.2.11"; }; }
```

When used in shellFor the tools will be compiled with the same version
of ghc used in the shell (the build ghc in the case of cross
compilation).

Instead of a version string we can use an attr set containing
arguments that will be passed to `cabalProject`.

For instance to specify the ghc used to compile. Use:

```
haskell-nix.tool "cabal" {
  version = "3.2.0.0";
  ghc = haskell-nix.compiler.ghc883;
}
```
2020-04-29 19:10:14 +12:00
Hamish Mackenzie 42f7eb16c7 Add missing import and fix typos in docs (#543) 2020-04-13 01:10:44 +12:00
Michael Peyton Jones eb15db0450 Expose our nixpkgs pins by restructuring default.nix (#514)
* Remove unused (and broken) test files

* Make default.nix expose pinned nixpkgs

Also make `nixpkgs/default.nix` just an attribute set of sources.
This is simpler, and consistent with what e.g. `niv` does.

* Add backwards compatibility shim, and version argument to allow evolution in future

* Fix some missed things

* Fix and improve quickstart
2020-03-31 09:12:40 +08:00
Toon Nolten 7874deb621 Updated the haskell.nix imports to overlay style (#357)
* Updated the haskell.nix imports to overlay style

Some of the examples in the documentation were still passing an empty
set to the haskell.nix imports but this is no longer valid because the
import now results in a set rather than a function.

* Fix overlay imports in docs

Import an overlayed nixpkgs rather than just the overlay.
Thanks to angerman for noticing this error.
2019-12-18 10:11:06 +08:00
Rodney Lorrimar b47a6bb1a2 shellFor: Use CABAL_CONFIG only with exactDeps = true (#255)
* shellFor: Use CABAL_CONFIG only with exactDeps = true

* shells: Put write-ghc-environment-files: never in cabal.config
2019-10-13 19:43:17 +08:00
Rodney Lorrimar ad640fa02d docs: Add note about shellFor and CABAL_CONFIG (#247) 2019-09-24 08:53:20 +10:00
Stefan Matting b0a7f89256 Add documentation on howto Hoogle (#203) 2019-07-14 13:06:47 +08:00
Aycan iRiCAN 866ac2363b docs: Replace misplaced semicolon with colon (#185) 2019-06-21 08:57:07 +10:00
Rodney Lorrimar 3747f54357 Update the docs (#165)
The docs are not complete yet, but we can start improving them from here.
2019-06-07 14:46:44 +10:00