Commit Graph

13 Commits

Author SHA1 Message Date
Asad Saeeduddin 3250b6cc7b Suggest adding Hydra substituter in docs (#823)
It seems [Hercules CI](https://hercules-ci.com/github/input-output-hk/haskell.nix) is having some problems, which means build outputs might not be available via the Cachix substituter.
2020-08-31 21:06:40 +12:00
John A. Lotoski 09526c8555 Spelling, typo and whitespace fixes (#833)
* Spelling and typo fixes in doc and code comments
* Trailing whitespace or whitespace only truncation
* readTheDocs formatting corrections
2020-08-31 11:08:25 +12:00
Hamish Mackenzie b6de6ef3b8 Remove components.all (#776)
It causes a lot of issues. To make this work:

* `shellFor` is updated to use `getAllComponents` instead of `.all`.
* `getAllComponents` is updated to work on the package rather than
  the package config.
* Tests updated to not use `.library` or `.exes.X` where appropriate.
* Documentation updated.
* Out of date examples removed.

As a bonus `shellFor` now takes a `components` argument that might be
useful for limiting the dependencies of the shell to just the ones
needed for the components you intend to work on.
2020-07-21 16:06:54 +12:00
Hamish Mackenzie cacfba0b45 Replace ghc 8.8.3 with 8.8.4 (#766)
Also adds some tooling/docs for adding new ghc versions (see `docs/adding-new-ghc.md`)
2020-07-21 14:10:23 +12:00
Hamish Mackenzie 4cac8bd00f Remove internal deps on default ghc and stackage (#738)
Changes to the interface of haskell.nix (from the changelog.md file):

* Removed `sources.nixpkgs-default`, use `sources.nixpkgs` instead.
* Removed `./nixpkgs` directory, use  `(import ./. {}).sources`
  or `./nix/sources.nix` instead.
* Removes V1 interface for details on how to fix old code see:
    https://github.com/input-output-hk/haskell.nix/issues/709
* Removed defaultCompilerNixName.
* cabalProject, cabalProject', hackage-project and hackage-package
  now require a `compiler-nix-name` argument.
* `haskell-nix.tool` and `.tools` now require a `compiler-nix-name` argument.
  New functions `p.tool` and `p.tools` (where p is a project) do not.
  Like `shellFor { tools = ... }` they will use the compiler nix name
  from the project (including stack projects where it is derived from
  the resolver).
* `haskell-nix.alex` and `haskell-nix.happy` have been removed. Use
  `p.tool "alex" "3.2.5"` or `shellFor { tools = { alex = "3.2.5"; } }`.
* `haskell-nix.nix-tools` -> `haskell-nix.nix-tools.ghc883` (it includes
  the hpack exe now).
* `haskell-nix.cabal-install` -> 
  `p.tool "cabal" "3.2.0.0"` or `shellFor { tools = { cabal = "3.2.0.0"; } }`
* `haskell-nix.haskellNixRoots` -> `haskell-nix.roots ghc883` or `p.roots`

Other changes:

Adds hpack executable to the nix-tools derivations.

Adds a `cabal-hpack` test to make sure `hpack` works with
`cabalProject`.

Reduces the number of calls to `cabalProject` (particularly when
checking materialization), by giving internal tools a per-compiler
attribute.

Uses happy 1.19.12 when building newer ghc versions.

Updates cabal-install 3.2.0.0 to use the source from github that
is compatible with ghc 8.10.1.

Updates the docs for callCabalProjectToNix.

Adds a license mapping to fix a common warning.
2020-07-08 22:54:01 +12:00
Domen Kožar 33445e4fb9 Add project, cabalProject, stackProject references (#753)
* Add project, cabalProject, stackProject references

* Update docs/reference/library.md

Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com>

Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com>
2020-07-08 21:25:24 +12:00
Arian van Putten 76e13925b1 Note that on Cabal 3.0 you can just use "cabal build" (#744) 2020-07-03 10:18:35 +12:00
Toon Nolten 5c4a0de2a1 Minor documentation fixes (#722)
* Make the haskell.nix import in the examples explicit

The examples used `import ./. {}` without explaining the commands should
be run from the haskell.nix repo root. To avoid confusion like this I
added fetching a tarball of the repo. This is less efficient when run
from the repo but works when run from anywhere and makes it clear we're
importing haskell.nix.

Added a couple urls and removed the urls on the lens component so as not
to confuse components with packages.

* Fix rephrase

The phrasing was left in a partially-rewritten state.

* Change wording and fix typo

* Minor fixes for consistency
2020-06-23 08:10:41 +10:00
Domen Kožar 1383a63ff6 fix getting started example and simplify (#711) 2020-06-19 21:15:07 +12:00
Domen Kožar a814a425f4 Expose handling of git repos in tutorial (#713) 2020-06-19 21:14:14 +12:00
Domen Kožar e56bbb39d1 Promote materialization and demote manual generation (#712) 2020-06-19 20:27:52 +12:00
Hamish Mackenzie 9e6820cc71 Add haskell-nix.project (and project') (#703)
Generalized version of the `cabalProject` and `stackProject`
functions.

Automatically selects the correct project type based on the
`projectFileName` argument if provided or what files exist in
the `src` directory if no `projectFileName` was specified.

If it cannot be determined which it should use the following
error message is given:

```
error: haskell-nix.project : both `stack.yaml` and `cabal.project` files exist set `projectFileName = "stack.yaml;"` or `projectFileName = "cabal.project";`
```
2020-06-19 20:07:19 +12:00
Domen Kožar 2852a9521f Reorganize tutorials (#702)
* fix hackage and stackage to work

* user-guides -> tutorials

* Restructure tutorials

* getting-started: clarify on packages and components

* Update docs/tutorials/development.md

Co-authored-by: Rodney Lorrimar <dev@rodney.id.au>

* getting-started: bail out if cabal.project and stack.yaml are present

* hackage-stackage: delete duplicated content

Co-authored-by: Rodney Lorrimar <dev@rodney.id.au>
2020-06-19 13:37:02 +12:00