Created
January 31, 2020 01:05
-
-
Save patrl/a1bf407dd9d76210905bdc29346aa007 to your computer and use it in GitHub Desktop.
Boilerplate for a nice haskell hacking experience, with nix, direnv, lorri, cabal new-*, and ghcide
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eval "$(lorri direnv)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cradle: {cabal: {}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc865" }: | |
let | |
inherit (nixpkgs) pkgs; | |
ghc = pkgs.haskell.packages.${compiler}.ghcWithPackages (ps: with ps; [ | |
cabal-install | |
brittany | |
ghcid | |
]); | |
in | |
with pkgs; | |
runCommand "dummy" { | |
buildInputs = [ | |
ghc | |
(import (builtins.fetchTarball "https://github.com/hercules-ci/ghcide-nix/tarball/master") {}).ghcide-ghc865 | |
]; | |
shellHook = '' | |
export NIX_GHC="${ghc}/bin/ghc" | |
export NIX_GHCPKG="${ghc}/bin/ghc-pkg" | |
export NIX_GHC_DOCDIR="${ghc}/share/doc/ghc/html" | |
export NIX_GHC_LIBDIR=$( $NIX_GHC --print-libdir ) | |
''; | |
} "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment