Wrap yesod-bin so that yesod devel works with Nix

This commit is contained in:
John Wiegley 2014-05-26 02:48:28 -05:00
parent b0234f216c
commit bf1bde8215

View File

@ -23,6 +23,18 @@ cabal.mkDerivation (self: {
systemFileio systemFilepath tar text time transformers unixCompat
unorderedContainers wai waiExtra warp yaml zlib
];
postInstall = ''
mv $out/bin/yesod $out/bin/.yesod-wrapped
cat - > $out/bin/yesod <<EOF
#! ${self.stdenv.shell}
export HSENV=1
export PACKAGE_DB_FOR_GHC='$( ${self.ghc.GHCGetPackages} ${self.ghc.version} | tr " " "\n" | tail -n +2 | paste -d " " - - | sed 's/.*/-g "&"/' | tr "\n" " ")'
eval exec $out/bin/.yesod-wrapped "\$@"
EOF
chmod +x $out/bin/yesod
'';
meta = {
homepage = "http://www.yesodweb.com/";
description = "The yesod helper executable";