From 7ac2b37f696ab8652b30ce897ab4515c5d3d71b1 Mon Sep 17 00:00:00 2001 From: toonn Date: Mon, 9 Dec 2019 21:18:02 +0100 Subject: [PATCH 1/2] 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. --- docs/user-guide/cabal-projects.md | 2 +- docs/user-guide/development.md | 4 ++-- docs/user-guide/stack-projects.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/user-guide/cabal-projects.md b/docs/user-guide/cabal-projects.md index 9a15362348..8d390213f3 100644 --- a/docs/user-guide/cabal-projects.md +++ b/docs/user-guide/cabal-projects.md @@ -81,7 +81,7 @@ instantiate a package set. # default.nix let # Import the Haskell.nix library, - haskell = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {}; + haskell = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz); # Instantiate a package set using the generated file. pkgSet = haskell.mkCabalProjectPkgSet { diff --git a/docs/user-guide/development.md b/docs/user-guide/development.md index 4aa3244eed..4a58c15eec 100644 --- a/docs/user-guide/development.md +++ b/docs/user-guide/development.md @@ -108,7 +108,7 @@ selects packages from the larger package set. ```nix # shell.nix let - haskell = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {}; + haskell = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz); in haskell.haskellPackages.ghcWithPackages (ps: with ps; [ lens conduit conduit-extra ]) @@ -125,7 +125,7 @@ project. ```nix let - haskell = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {}; + haskell = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz); in haskell.snapshots."lts-13.18".alex.components.exes.alex ``` diff --git a/docs/user-guide/stack-projects.md b/docs/user-guide/stack-projects.md index 6e8711ca60..98dcbb3512 100644 --- a/docs/user-guide/stack-projects.md +++ b/docs/user-guide/stack-projects.md @@ -43,7 +43,7 @@ instantiate a package set. # default.nix let # Import the Haskell.nix library, - haskell = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {}; + haskell = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz); # Instantiate a package set using the generated file. pkgSet = haskell.mkStackPkgSet { From 4de209c4133b90a7fd5e5f8e38cd3abd6fc6a0c1 Mon Sep 17 00:00:00 2001 From: toonn Date: Tue, 17 Dec 2019 11:24:31 +0100 Subject: [PATCH 2/2] Fix overlay imports in docs Import an overlayed nixpkgs rather than just the overlay. Thanks to angerman for noticing this error. --- docs/user-guide/cabal-projects.md | 4 +++- docs/user-guide/development.md | 8 ++++++-- docs/user-guide/stack-projects.md | 4 +++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/user-guide/cabal-projects.md b/docs/user-guide/cabal-projects.md index 8d390213f3..00431b4281 100644 --- a/docs/user-guide/cabal-projects.md +++ b/docs/user-guide/cabal-projects.md @@ -81,7 +81,9 @@ instantiate a package set. # default.nix let # Import the Haskell.nix library, - haskell = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz); + src = builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz; + nixpkgs = import (src + "/nixpkgs") (import src); + haskell = nixpkgs.haskell-nix; # Instantiate a package set using the generated file. pkgSet = haskell.mkCabalProjectPkgSet { diff --git a/docs/user-guide/development.md b/docs/user-guide/development.md index 4a58c15eec..03aea45187 100644 --- a/docs/user-guide/development.md +++ b/docs/user-guide/development.md @@ -108,7 +108,9 @@ selects packages from the larger package set. ```nix # shell.nix let - haskell = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz); + src = builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz; + nixpkgs = import (src + "/nixpkgs") (import src); + haskell = nixpkgs.haskell-nix; in haskell.haskellPackages.ghcWithPackages (ps: with ps; [ lens conduit conduit-extra ]) @@ -125,7 +127,9 @@ project. ```nix let - haskell = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz); + src = builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz; + nixpkgs = import (src + "/nixpkgs") (import src); + haskell = nixpkgs.haskell-nix; in haskell.snapshots."lts-13.18".alex.components.exes.alex ``` diff --git a/docs/user-guide/stack-projects.md b/docs/user-guide/stack-projects.md index 98dcbb3512..b93573ec0f 100644 --- a/docs/user-guide/stack-projects.md +++ b/docs/user-guide/stack-projects.md @@ -43,7 +43,9 @@ instantiate a package set. # default.nix let # Import the Haskell.nix library, - haskell = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz); + src = builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz; + nixpkgs = import (src + "/nixpkgs") (import src); + haskell = nixpkgs.haskell-nix; # Instantiate a package set using the generated file. pkgSet = haskell.mkStackPkgSet {