Skip to content

Update specific package building tutorial #867

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/tutorials/building-package-from-stackage-hackage.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
To build a package, say [lens][], from a Stackage snapshot, say
[lts-13.28][], you could run:
```bash
nix build '(with import <nixpkgs> (import (builtins.fetchTarball "https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz")).nixpkgsArgs; haskell-nix.snapshots."lts-13.28").lens.components.library'
nix build '(with import <nixpkgs> (import (builtins.fetchTarball "https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz") {}).nixpkgsArgs; haskell-nix.snapshots."lts-13.28").lens.components.library'
```
This would build the (public) library component of the [lens][] package as
fixed by the [lts-13.28][] stackage snapshot. Nightly snapshots like
Expand All @@ -17,7 +17,7 @@ fixed by the [lts-13.28][] stackage snapshot. Nightly snapshots like
To build any package from hackage, say [lens][], at any version, say 4.17.1,
you could run:
```bash
nix build '(with import <nixpkgs> (import (builtins.fetchTarball "https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz")).nixpkgsArgs; (haskell-nix.hackage-package { name = "lens"; version = "4.17.1"; })).components.library'
nix build '(with import <nixpkgs> (import (builtins.fetchTarball "https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz") {}).nixpkgsArgs; (haskell-nix.hackage-package { name = "lens"; version = "4.17.1"; compiler-nix-name = "ghc8102"; })).components.library'
```
This would build the (public) library component of the [lens-4.17.1][] package
from hackage.
Expand All @@ -28,7 +28,7 @@ The dependencies would be resolved against the most recent
[hackage-index-state][] which comes with your [haskell.nix][] checkout via the
[hackage.nix][] pin. A specific one can be specified as well:
```bash
nix build '(with import <nixpkgs> (import (builtins.fetchTarball "https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz")).nixpkgsArgs; (haskell-nix.hackage-package { name = "lens"; version = "4.17.1"; index-state = "2019-07-14T00:00:00Z"; })).components.library'
nix build '(with import <nixpkgs> (import (builtins.fetchTarball "https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz") {}).nixpkgsArgs; (haskell-nix.hackage-package { name = "lens"; version = "4.17.1"; compiler-nix-name = "ghc8102"; index-state = "2019-07-14T00:00:00Z"; })).components.library'
```
This would use the hackage index as of `2019-07-14T00:00:00Z` to produce a
build plan for the [lens-4.17.1][] package.
Expand Down