-
-
Save codygman/0fcc522ee1ef37158253239a0b6980f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ mkDerivation, base, lens, stdenv, webdriver }: | |
mkDerivation { | |
pname = "myproject"; | |
version = "0.1.0.0"; | |
src = ./.; | |
isLibrary = false; | |
isExecutable = true; | |
executableHaskellDepends = [ base lens webdriver ]; | |
license = stdenv.lib.licenses.unfree; | |
hydraPlatforms = stdenv.lib.platforms.none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Initial myproject.cabal generated by cabal init. For | |
-- further documentation, see http://haskell.org/cabal/users-guide/ | |
name: myproject | |
version: 0.1.0.0 | |
-- synopsis: | |
-- description: | |
license: AllRightsReserved | |
license-file: LICENSE | |
author: name | |
maintainer: email | |
-- copyright: | |
category: Web | |
build-type: Simple | |
extra-source-files: ChangeLog.md | |
cabal-version: >=1.10 | |
executable myproject | |
main-is: Main.hs | |
-- other-modules: | |
-- other-extensions: | |
build-depends: base | |
, lens | |
, webdriver | |
hs-source-dirs: src | |
default-language: Haskell2010 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }: | |
let | |
inherit (nixpkgs) pkgs; | |
webdriver = pkgs.haskellPackages.callHackage "webdriver" "0.8.5" {}; | |
f = { mkDerivation, base, lens, stdenv, webdriver }: | |
mkDerivation { | |
pname = "myproject"; | |
version = "0.1.0.0"; | |
src = ./.; | |
isLibrary = false; | |
isExecutable = true; | |
# buildInputs = [ pkgs.chromeDriver ]; # this is invalid | |
executableHaskellDepends = [ base lens webdriver ]; | |
license = stdenv.lib.licenses.unfree; | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment