Skip to content

Commit 7874deb

Browse files
toonnangerman
authored andcommitted
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.
1 parent bf7b6d9 commit 7874deb

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

docs/user-guide/cabal-projects.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ instantiate a package set.
8181
# default.nix
8282
let
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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ selects packages from the larger package set.
108108
```nix
109109
# shell.nix
110110
let
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;
112114
in
113115
haskell.haskellPackages.ghcWithPackages (ps: with ps;
114116
[ lens conduit conduit-extra ])
@@ -125,7 +127,9 @@ project.
125127

126128
```nix
127129
let
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;
129133
in
130134
haskell.snapshots."lts-13.18".alex.components.exes.alex
131135
```

docs/user-guide/stack-projects.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ instantiate a package set.
4343
# default.nix
4444
let
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 {

0 commit comments

Comments
 (0)