seal-blog/shell.nix

43 lines
1.2 KiB
Nix
Raw Normal View History

2020-09-09 22:27:03 -04:00
# https://wizzup.github.io/posts/nix-shell-haskell-invocation/
# shell.nix for nix-shell (haskell)
{ pkgs ? import <nixpkgs> {} }:
let
pkgs = import (builtins.fetchGit {
# Descriptive name to make the store path easier to identify
name = "hakyll-4.13.3.0";
url = "https://github.com/nixos/nixpkgs-channels/";
ref = "refs/heads/nixpkgs-unstable";
rev = "fa54dd346fe5e73d877f2068addf6372608c820b";
}) {};
myPkg = pkgs.haskellPackages.hakyll;
2020-09-09 22:27:03 -04:00
ghc = pkgs.haskellPackages.ghcWithHoogle (self: with self; [
2020-12-04 08:30:32 -05:00
# hspec
split
2020-12-04 08:30:32 -05:00
# myPkg # hakyll
random
neat-interpolation
]);
2020-09-09 22:27:03 -04:00
in
pkgs.mkShell {
name = "haskell-shell";
buildInputs = (with pkgs.haskellPackages; [
ghc
hlint
2020-12-04 08:30:32 -05:00
# stack
# ghcjs-dom
# cabal-install
2020-09-09 22:27:03 -04:00
]) ++ (with pkgs; [
nano
]);
shellHook = ''
eval "$(egrep ^export "$(type -p ghc)")"
export PS1="\[\033[1;32m\][ns-hs:\w]\n$ \[\033[0m\]"
'';
}