summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngolf Wanger <contact@ingolf-wagner.de>2019-05-24 14:39:40 +0200
committerIngolf Wanger <contact@ingolf-wagner.de>2019-05-24 14:39:40 +0200
commit25ffc6db68e5d5ff53df69209f6e26d02249639f (patch)
tree4c7e238306c5d94ddfd8d13dc7c53769933f3c42
parent89662dba0bed1054e941b417006a57c1db6e2c63 (diff)
haskell add shell.nixHEADmaster
-rw-r--r--haskell/shell.nix55
1 files changed, 55 insertions, 0 deletions
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 <nixpkgs> { } }:
+
+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}
+ '';
+
+}