From 25ffc6db68e5d5ff53df69209f6e26d02249639f Mon Sep 17 00:00:00 2001 From: Ingolf Wanger Date: Fri, 24 May 2019 14:39:40 +0200 Subject: haskell add shell.nix --- haskell/shell.nix | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 haskell/shell.nix diff --git a/haskell/shell.nix b/haskell/shell.nix new file mode 100644 index 0000000..0f56c71 --- /dev/null +++ b/haskell/shell.nix @@ -0,0 +1,55 @@ +{ pkgs ? import { } }: + +let + + all-hies = import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master") {}; + + script = { + build = pkgs.writeShellScriptBin "build" /* sh */ '' + echo "this could be your buildscript" + ''; + run = pkgs.writeShellScriptBin "run" /* sh */ '' + echo "this could be your run script" + ''; + }; + +in pkgs.mkShell { + + buildInputs = with pkgs; [ + script.build + script.run + + # common tools + # ------------ + cabal2nix + cabal-install + + stylish-cabal + haskellPackages.stylish-haskell + haskellPackages.hoogle + + # automatically create CI scripts + # https://github.com/haskell-CI/haskell-ci#quick-start-instructions + haskell-ci + + # IDE setups + # ---------- + + # VSCode hde setup + # https://github.com/haskell/haskell-ide-engine#using-vs-code-with-nix + (pkgs.vscode.overrideDerivation (old: { + postFixup = '' + wrapProgram $out/bin/code --prefix PATH : ${lib.makeBinPath [ + # Install stable HIE for GHC 8.6.4 (multiple ghc versions are allowed) + (all-hies.selection { selector = p: { inherit (p) ghc864; }; }) + ]} + ''; + })) + + ]; + + shellHook = '' + HISTFILE=${toString ./.history} + ''; + +} -- cgit v1.2.3