on iko/ghcjs-patch-master help sign in
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.

commit7874deb621327bd5b247ac3f18b4ea066c31c20d authorToon Nolten <toonn@toonn.io> dateWed 18 Dec 2019, 03:11 (7 years ago) parentbf7b6d9
3 files changed+12−4
docs/user-guide/cabal-projects.md+3−1 docs/user-guide/development.md+6−2 docs/user-guide/stack-projects.md+3−1
docs/user-guide/cabal-projects.md+3−1
@@ -81,7 +81,9 @@ instantiate a package set.
8181# default.nix
8282let
8383 # Import the Haskell.nix library,
84− haskell = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {};
84+ src = builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz;
85+ nixpkgs = import (src + "/nixpkgs") (import src);
86+ haskell = nixpkgs.haskell-nix;
8587
8688 # Instantiate a package set using the generated file.
8789 pkgSet = haskell.mkCabalProjectPkgSet {
docs/user-guide/development.md+6−2
@@ -108,7 +108,9 @@ selects packages from the larger package set.
108108```nix
109109# shell.nix
110110let
111− haskell = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {};
111+ src = builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz;
112+ nixpkgs = import (src + "/nixpkgs") (import src);
113+ haskell = nixpkgs.haskell-nix;
112114in
113115 haskell.haskellPackages.ghcWithPackages (ps: with ps;
114116 [ lens conduit conduit-extra ])
@@ -125,7 +127,9 @@ project.
125127
126128```nix
127129let
128− haskell = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {};
130+ src = builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz;
131+ nixpkgs = import (src + "/nixpkgs") (import src);
132+ haskell = nixpkgs.haskell-nix;
129133in
130134 haskell.snapshots."lts-13.18".alex.components.exes.alex
131135```
docs/user-guide/stack-projects.md+3−1
@@ -43,7 +43,9 @@ instantiate a package set.
4343# default.nix
4444let
4545 # Import the Haskell.nix library,
46− haskell = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {};
46+ src = builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz;
47+ nixpkgs = import (src + "/nixpkgs") (import src);
48+ haskell = nixpkgs.haskell-nix;
4749
4850 # Instantiate a package set using the generated file.
4951 pkgSet = haskell.mkStackPkgSet {