From a00439e7ce552a077d98f787f620179dce0f6df1 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 5 Nov 2014 03:35:53 +0100 Subject: simplify env.nix --- env.nix | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/env.nix b/env.nix index bb11ab4..da5df4d 100644 --- a/env.nix +++ b/env.nix @@ -1,25 +1,28 @@ +{ pkgs ? import {} +}: + let name = "cgserver"; version = "1"; + buildInputs = with pkgs; [ hsEnv ]; - extraCmds = with pkgs; '' + + extraCmds = '' export HISTFILE="\$HOME/.history/env-${name}" $(grep export ${hsEnv.outPath}/bin/ghc) ''; - pkgs = import {} // (with pkgs; { - }); - hsEnv = pkgs - .haskellPackages_ghc783_profiling - .ghcWithPackages (hsPkgs: with hsPkgs; - let - in - (callPackage ./. { devel = true; }).nativeBuildInputs ++ [ - cabalInstall - ]); + + hsEnv = pkgs.haskellPackages_ghc783_profiling.ghcWithPackages + (self : with self; + (callPackage ./. {}).nativeBuildInputs ++ + [ + cabalInstall + ] + ); + in pkgs.myEnvFun { name = "${name}-${version}"; inherit buildInputs extraCmds; } -# vim: set fdm=marker : -- cgit v1.2.3