I'm trying to make a Haskell development environment for a web project that just has the dependencies hakyll
, blaze
, and clay
. Only, clay appears to fail to build, complaining that Setup: Encountered missing dependencies:
hspec >=2.2.0 && <2.6, hspec-discover >=2.2.0 && <2.6
, and I can't seem to get past this.
I tried running cabal2nix . --shell > shell.nix
on this cabal file:
name: open-editions
version: 0.1.0.0
build-type: Simple
cabal-version: >= 1.10
executable site
main-is: site.hs
build-depends: base == 4.*
, blaze-html
, clay
, hakyll == 4.12.*
ghc-options: -threaded
default-language: Haskell2010
But I'm running into the missing dependencies problem. Any ideas?
Edit: here's the shell.nix that I'm generating from the above, using cabal2nix:
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }:
let
inherit (nixpkgs) pkgs;
f = { mkDerivation, base, blaze-html, clay, hakyll, stdenv }:
mkDerivation {
pname = "open-editions";
version = "0.1.0.0";
src = ./.;
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [ base blaze-html clay hakyll ];
license = "unknown";
hydraPlatforms = stdenv.lib.platforms.none;
};
haskellPackages = if compiler == "default"
then pkgs.haskellPackages
else pkgs.haskell.packages.${compiler};
variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;
drv = variant (haskellPackages.callPackage f {});
in
if pkgs.lib.inNixShell then drv.env else drv
And here's how I've been trying to modify it, so that it overrides Clay:
{ haskellLib, super, nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }:
let
inherit (nixpkgs) pkgs;
clay = haskellLib.doJailbreak super.clay;
f = { mkDerivation, base, blaze-html, clay, hakyll, stdenv }:
mkDerivation {
pname = "open-editions";
version = "0.1.0.0";
src = ./.;
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [ base blaze-html clay hakyll ];
license = "unknown";
hydraPlatforms = stdenv.lib.platforms.none;
};
haskellPackages = if compiler == "default"
then pkgs.haskellPackages
else pkgs.haskell.packages.${compiler};
variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;
drv = variant (haskellPackages.callPackage f {});
in
if pkgs.lib.inNixShell then drv.env else drv
But I'm obviously doing something wrong, since I'm getting: error: cannot auto-call a function that has an argument without a default value ('haskellLib')
.