parrotbot/shell.nix

30 lines
809 B
Nix
Raw Permalink Normal View History

2021-03-27 03:17:39 +00:00
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }:
let
inherit (nixpkgs) pkgs;
2021-03-27 05:06:34 +00:00
f = { mkDerivation, base, lib, mtl, network }:
2021-03-27 03:17:39 +00:00
mkDerivation {
pname = "parrotbot";
version = "0.0.0.0";
src = ./.;
isLibrary = false;
isExecutable = true;
2021-03-27 05:06:34 +00:00
executableHaskellDepends = [ base mtl network ];
2021-03-27 03:17:39 +00:00
description = "polly wanna cracker";
license = lib.licenses.gpl3Plus;
};
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