Skip to content

Commit

Permalink
simplifying nix shell
Browse files Browse the repository at this point in the history
  • Loading branch information
gvolpe committed Apr 23, 2020
1 parent 6d22f3a commit af0c036
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 47 deletions.
2 changes: 0 additions & 2 deletions default.nix

This file was deleted.

4 changes: 0 additions & 4 deletions release.nix

This file was deleted.

32 changes: 16 additions & 16 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{ nixpkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs-channels/archive/1fe82110feb.tar.gz") {} }:
let
inherit (nixpkgs) pkgs;
pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs-channels/archive/1fe82110feb.tar.gz") {};
inherit (pkgs) haskellPackages;
drv = haskellPackages.callCabal2nix "shopping-cart" ./. {};

project = import ./release.nix;
in
pkgs.stdenv.mkDerivation {
name = "shell";
buildInputs = project.env.nativeBuildInputs ++ [
haskellPackages.cabal-install
haskellPackages.hlint
];
shellHook = ''
export NIX_GHC="$(which ghc)"
export NIX_GHCPKG="$(which ghc-pkg)"
export NIX_GHC_DOCDIR="$NIX_GHC/../../share/doc/ghc/html"
export NIX_GHC_LIBDIR="$(ghc --print-libdir)"
'';
}
{
my_project = drv;
shell = haskellPackages.shellFor {
withHoogle = true;
packages = p: [drv];
buildInputs = with haskellPackages; [ hlint cabal-install ];
shellHook = ''
export NIX_GHC="$(which ghc)"
export NIX_GHCPKG="$(which ghc-pkg)"
export NIX_GHC_DOCDIR="$NIX_GHC/../../share/doc/ghc/html"
export NIX_GHC_LIBDIR="$(ghc --print-libdir)"
'';
};
}.shell
25 changes: 0 additions & 25 deletions shopping-cart.nix

This file was deleted.

0 comments on commit af0c036

Please sign in to comment.