Skip to content

Instantly share code, notes, and snippets.

@HoldenLucas
Forked from rpearce/.ghci
Created April 14, 2022 23:25
Show Gist options
  • Save HoldenLucas/177fa32edd4995023db4e5427ebfc323 to your computer and use it in GitHub Desktop.
Save HoldenLucas/177fa32edd4995023db4e5427ebfc323 to your computer and use it in GitHub Desktop.
Flake for using Haskell in nix develop
:def hoogle \x -> return $ ":!hoogle --count=15 \"" ++ x ++ "\""
:def doc \x -> return $ ":!hoogle --info \"" ++ x ++ "\""
:set -Wall
:set -fno-warn-type-defaults -ferror-spans -freverse-errors -fprint-expanded-synonyms
:set prompt "\ESC[0;32m%s\n\ESC[m[ghci]\ESC[38;5;172mλ \ESC[m"
:set prompt-cont " \ESC[38;5;172m> \ESC[m"
{
description = "Simple haskell nix flake";
nixConfig.bash-prompt = "[nix]\\e\[38;5;172mλ \\e\[m";
inputs = {
nixpkgs.url = "nixpkgs/nixos-21.05";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { flake-utils, nixpkgs, self }:
flake-utils.lib.eachDefaultSystem (system:
let
config = {};
overlays = [];
pkgs = import nixpkgs { inherit config overlays system; };
in rec {
devShell = pkgs.haskellPackages.shellFor {
packages = p: [
];
buildInputs = with pkgs.haskellPackages; [
cabal-install
# Helpful tools for `nix develop` shells
#
#ghcid # https://github.com/ndmitchell/ghcid
#haskell-language-server # https://github.com/haskell/haskell-language-server
#hlint # https://github.com/ndmitchell/hlint
#ormolu # https://github.com/tweag/ormolu
];
withHoogle = true;
};
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment