From 39de6510e0830df7ca36ec0da2f4aaf485be0283 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 7 May 2016 20:29:45 +0200 Subject: build system --- shell.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 shell.nix (limited to 'shell.nix') diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..294fea0 --- /dev/null +++ b/shell.nix @@ -0,0 +1,17 @@ +{ pkgs ? (import {}) +, haskellPackages ? (import ./default.nix { inherit pkgs; }).haskellPackages +}: + +let + ghc = (haskellPackages.ghcWithPackages (ps: (payload ++ depends ++ (with ps; [ hlint cabal2nix cabal-install ])))).override { ignoreCollisions = true; }; + payload = builtins.attrValues (import ./default.nix {}); + depends = builtins.concatLists (builtins.map (x: if builtins.hasAttr "nativeBuildInputs" x then x.nativeBuildInputs else []) (builtins.attrValues (import ./default.nix {}))); +in pkgs.stdenv.mkDerivation rec { + bareName = "sequence"; + name = "${bareName}-env"; + buildInputs = [ ghc ]; + shellHook = '' + eval $(egrep ^export ${ghc}/bin/ghc) + export PROMPT_INFO="${name}" + ''; +} -- cgit v1.2.3