I'm looking for something similar to this:
shell.nix
{ pkgs ? import <nixpkgs> {} }:
let
threadscope = ...
speedscope = ...
in
stdenv.mkDerivation {
name = "haskell-env";
nativeBuildInputs = [
# Haskell tools
ghcid ghc
# Profiling tools
threadscope
speedscope
];
}
Then I can use nix-shell
:
% nix-shell
...
nix-shell % threadscope <some-commands>
nix-shell % speedscope <some-commands>
Do you usually just build from source from github / hackage / stackage or use pkgs.haskellPackages.<my-package>
?
I usually take tools from
haskellPackages
.If you only want a shell with tools, you can use an expression like this.
If you want a shell with specific precompiled libraries, you can use the
ghcWithPackages
function instead ofghc
. If you want precompiled dependencies for your local Haskell package(s), you can replacepkgs.mkShell
by thehaskellPackages.shellFor
function.If you'd like to package speedscope, the Nixpkgs manual documents the packaging process for node packages