mirror of
https://github.com/qfpl/applied-fp-course.git
synced 2024-11-30 12:23:25 +03:00
52d7a6fe75
Not written up with comments or even very clean at the moment. Trying to decide between exceptions and YAML or no exceptions but manual parsing for JSON config file. Or something else entirely...
14 lines
350 B
Nix
14 lines
350 B
Nix
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default" }:
|
|
|
|
let
|
|
inherit (nixpkgs) pkgs;
|
|
|
|
haskellPackages = if compiler == "default"
|
|
then pkgs.haskellPackages
|
|
else pkgs.haskell.packages.${compiler};
|
|
|
|
drv = haskellPackages.callPackage ./default.nix {};
|
|
|
|
in
|
|
if pkgs.lib.inNixShell then drv.env else drv
|