Hi,
I am trying to build a haskell executable and wondering where I am going wrong:
{ pkgs ? (import <nixpkgs>{}),
mkDerivation ? pkgs.stdenv.mkDerivation,
base ? pkgs.haskellPackages.base,
clay ? pkgs.haskellPackages.clay,
scotty ? pkgs.haskellPackages.scotty}:
mkDerivation {
pname = "Scotty";
version = "0.1.0.0";
src = ./.;
isLibrary = false;
isExecutable = true;
libraryHaskellDepends = [ base ];
buildOptions = with pkgs;[cabal-install ghc];
executableHaskellDepends = [ base clay scotty ];
license = "unknown";
buildPhase = ''
alias cabal=".${pkgs.cabal-install}/bin/cabal";
alias ghc="$.{pkgs.ghc}/bin/ghc";
cabal build
'';
shellHook = ''
alias cabal="${pkgs.cabal-install}/bin/cabal";
alias ghc="${pkgs.ghc}/bin/ghc";
cabal build
'';
}
For some reason, cabal doesn’t seem to find ghc - althought it is aliased when the build happens. The same goes for running nix-shell
. But then when I open the environment and run ghc
or cabal
they both seem to be working fine. Can you please point out to me where I am going wrong?
Thank you.