Integrate stack in the nix-shell environment

This commit is contained in:
Remo
2020-04-22 14:30:02 -05:00
committed by Steve Chavez
parent a7c396e464
commit 178c5d54d5
2 changed files with 11 additions and 1 deletions
+3 -1
View File
@@ -38,7 +38,9 @@ nix-shell
``` ```
Within `nix-shell`, you can run Cabal commands as usual. Within `nix-shell`, you can run Cabal commands as usual. You can also run
stack with the `--nix` option, which causes stack to pick up the non-Haskell
dependencies from the same pinned Nixpkgs version that the Nix builds use.
## Tour ## Tour
+8
View File
@@ -4,9 +4,17 @@ pkgs.lib.overrideDerivation env (
buildInputs = buildInputs =
base.buildInputs ++ [ base.buildInputs ++ [
pkgs.cabal-install pkgs.cabal-install
pkgs.stack
pkgs.cabal2nix pkgs.cabal2nix
pkgs.postgresql pkgs.postgresql
nixpkgsUpgrade nixpkgsUpgrade
]; ];
shellHook =
''
# Set our pinned version of Nixpkgs in the NIX_PATH so that
# `stack --nix` also uses that version.
NIX_PATH="nixpkgs=${pinnedPkgs}"
'';
} }
) )