qfpl / applied-fp-course

Applied Functional Programming Course - Move from exercises to a working app!

Home Page:http://qfpl.io/projects/professional-fp-courses/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please add `cabal-install` to default.nix

wizzup opened this issue · comments

I think nix expression should self-contains and not assume cabal-install already exist on the system.

I try to add cabal-install to default.nix but somehow fail

$ git diff
diff --git a/default.nix b/default.nix
index 21e0aed..d51fa06 100644
--- a/default.nix
+++ b/default.nix
@@ -12,5 +12,6 @@ let

   drv = haskellPackages.callPackage ./applied-fp-course.nix {};

+  drvWithTools = pkgs.haskell.lib.addBuildDepends drv [ pkgs.cabal-install ];
 in
-  drv
+  if pkgs.lib.inNixShell then drvWithTools.env else drv
$ nix-shell
error: attribute 'override' missing, at /nix/store/4vhnyxwg0bv15zvhqixgwhb1a1h5pa1w-source/pkgs/development/haskell-modules/lib.nix:37:28

Also introducing shell.nix could be one way to solve the problem and open for adding additional tools (for example: linter, ide tools) to the shell.

Oops! there is already shell.nix, please forgive my ignorance.