{ nixpkgs ? import {}, compiler ? "default", doBenchmark ? false }: let inherit (nixpkgs) pkgs; haskellPackages = if compiler == "default" then pkgs.haskellPackages else pkgs.haskell.packages.${compiler}; variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id; # Example code's build-depends are behind flag, so cabal2nix doesn't # add it automatically. libtelnet = with haskellPackages; pkgs.haskell.lib.addBuildDepends (callPackage ./libtelnet.nix {}) [monad-loops network-simple]; in variant libtelnet