her.esy.fun/src/posts/0011-Haskell-Projects/shell.nix

45 lines
1 KiB
Nix
Raw Normal View History

2020-02-03 09:10:41 +00:00
{ nixpkgs ? import (fetchGit {
name = "nixos-release-19.09";
url = "https://github.com/NixOS/nixpkgs";
# obtained via
# git ls-remote https://github.com/nixos/nixpkgs master
ref = "refs/heads/nixpkgs-19.09-darwin";
rev = "d5291756487d70bc336e33512a9baf9fa1788faf";
}) { config = { allowBroken = true; }; } }:
2020-02-02 15:06:07 +00:00
let
2020-02-03 09:10:41 +00:00
inherit (nixpkgs) pkgs;
inherit (pkgs) haskellPackages;
haskellDeps = ps: with ps; [
base
protolude
containers
];
2020-02-02 15:06:07 +00:00
2020-02-03 09:10:41 +00:00
hspkgs = haskellPackages;
2020-02-02 15:06:07 +00:00
2020-02-03 09:10:41 +00:00
# ### how to override package version
# hspkgs = haskellPackages.extend (self: super: {
# summoner = self.callHackage "summoner" "1.4.0.0" {};
# # summoner-tui = self.callHackage "summoner-tui" "1.4.0.0" {};
# });
2020-02-02 15:06:07 +00:00
2020-02-03 09:10:41 +00:00
ghc = hspkgs.ghcWithPackages haskellDeps;
nixPackages = [
ghc
pkgs.gdb
hspkgs.summoner
hspkgs.summoner-tui
haskellPackages.cabal-install
haskellPackages.ghcid
];
in
pkgs.stdenv.mkDerivation {
name = "env";
buildInputs = nixPackages;
shellHook = ''
2020-02-02 15:06:07 +00:00
export PS1="\n\[[hs:\033[1;32m\]\W\[\033[0m\]]> "
'';
2020-02-03 09:10:41 +00:00
}