Skip to content

Commit cdb3cf5

Browse files
committed
feat: working hie, stolen from https://github.com/michalrus/kornel
1 parent 73eda75 commit cdb3cf5

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

shell.nix

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,25 @@
66
let
77
pkgs = (import ./release.nix { inherit nixpkgs compiler; });
88

9-
inherit (pkgs.haskellPackages) nixfromnpm;
9+
inherit (pkgs) haskellPackages;
1010

11-
haskellPackages = if compiler == null then pkgs.haskellPackages
12-
else pkgs.haskell.packages."${compiler}";
11+
inherit (haskellPackages) nixfromnpm;
1312

14-
my-intero =
15-
(import ((import <nixpkgs> {}).pkgs.fetchFromGitHub {
16-
owner = "NixOS"; repo = "nixpkgs";
17-
rev = "2c1838ab99b";
18-
sha256 = "0lz9gmb97y6cvjj5pbz89cx97c6d49v5nmfwh8sbmgfmqy8cfwxp";
19-
}) {}).haskellPackages.intero;
20-
21-
22-
ghc = haskellPackages.ghcWithPackages (ps: with ps; [
23-
monad-par mtl my-intero QuickCheck
24-
]);
13+
hie = (import ((import nixpkgs {}).fetchFromGitHub {
14+
owner = "domenkozar"; repo = "hie-nix";
15+
rev = "e3113da93b479bec3046e67c0123860732335dd9";
16+
sha256 = "05rkzjvzywsg66iafm84xgjlkf27yfbagrdcb8sc9fd59hrzyiqk";
17+
}) {}).hie82;
2518
in
2619

27-
pkgs.stdenv.mkDerivation {
28-
name = "my-haskell-env-0";
29-
buildInputs = [ ghc ];
30-
shellHook = "eval $(egrep ^export ${ghc}/bin/ghc)";
31-
}
20+
pkgs.lib.overrideDerivation nixfromnpm.env (oldAttrs: {
21+
buildInputs =
22+
oldAttrs.buildInputs ++
23+
[ hie ] ++
24+
(with haskellPackages; [cabal-install hlint hindent stylish-haskell]);
25+
26+
# Caution: leave oldAttrs.shellHook in place, or HIE will break (just HIE!).
27+
shellHook = oldAttrs.shellHook + ''
28+
export NIX_PATH='nixpkgs=${nixpkgs}'
29+
'';
30+
})

0 commit comments

Comments
 (0)