2014-10-15 04:23:05 +01:00
|
|
|
|
# This is a manually-written expression over an in-tree cabal file.
|
|
|
|
|
# It's awkward but this way allows the package user to pass in
|
|
|
|
|
# extraPackages without much extra hassle on their end, similarly how
|
|
|
|
|
# the XMonad service handles it: the difference is that we don't have
|
|
|
|
|
# anything like XMONAD_GHC…
|
|
|
|
|
#
|
|
|
|
|
# The idea is that the user changes their configs using any libraries
|
|
|
|
|
# he likes and then builds it using this expression. Once that's done,
|
|
|
|
|
# ‘reload’ and similar functions should all work as long as the user
|
|
|
|
|
# doesn't need new libraries at which point they should add them to
|
|
|
|
|
# extraPackages and rebuild from the expression.
|
2014-10-17 00:06:07 +01:00
|
|
|
|
{ cabal, yi, extraPackages, makeWrapper, ghcWithPackages }:
|
|
|
|
|
let
|
|
|
|
|
w = ghcWithPackages (self: [ yi ] ++ extraPackages self);
|
|
|
|
|
wrappedGhc = w.override { ignoreCollisions = true; };
|
|
|
|
|
in
|
2014-10-15 04:23:05 +01:00
|
|
|
|
cabal.mkDerivation (self: rec {
|
|
|
|
|
pname = "yi-custom";
|
|
|
|
|
version = "0.0.0.1";
|
|
|
|
|
src = ./yi-custom-cabal;
|
|
|
|
|
isLibrary = true;
|
2014-10-17 00:06:07 +01:00
|
|
|
|
buildDepends = [ yi ];
|
2014-10-15 04:23:05 +01:00
|
|
|
|
buildTools = [ makeWrapper ];
|
|
|
|
|
noHaddock = true;
|
|
|
|
|
doCheck = false;
|
|
|
|
|
|
2014-10-17 00:06:07 +01:00
|
|
|
|
# put custom GHC env in front which stops crap from being picked up
|
|
|
|
|
# from user database
|
2014-10-15 04:23:05 +01:00
|
|
|
|
postInstall = ''
|
2014-10-17 00:06:07 +01:00
|
|
|
|
makeWrapper ${yi}/bin/yi $out/bin/yi --prefix PATH : ${wrappedGhc}/bin
|
2014-10-15 04:23:05 +01:00
|
|
|
|
'';
|
|
|
|
|
meta = {
|
|
|
|
|
homepage = "http://haskell.org/haskellwiki/Yi";
|
|
|
|
|
description = "Wrapper over user-specified Haskell libraries for use in Yi config";
|
|
|
|
|
license = self.stdenv.lib.licenses.publicDomain;
|
|
|
|
|
platforms = self.ghc.meta.platforms;
|
|
|
|
|
maintainers = with self.stdenv.lib.maintainers; [ fuuzetsu ];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
})
|