diff --git a/.travis.yml b/.travis.yml index 071e2622..3e75c647 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,3 +27,7 @@ script: - if [ "$TRAVIS_BRANCH" == "master" ]; then make stylish && git diff-index --quiet HEAD; fi - make test-libraries + +- curl https://nixos.org/nix/install | sh +- . $HOME/.nix-profile/etc/profile.d/nix.sh +- stack --nix test hs-abci-types hs-abci-server hs-abci-sdk diff --git a/shell-stack.nix b/shell-stack.nix new file mode 100644 index 00000000..d20eb9c9 --- /dev/null +++ b/shell-stack.nix @@ -0,0 +1,14 @@ +{ ghc +, nixpkgs ? import (builtins.fetchTarball { + name = "nixpkgs-PR-71165"; + url = https://github.com/nixos/nixpkgs/archive/e3b740516f05307b55bcdb7e46c5d55da5fe0443.tar.gz; + sha256 = "0ssl12nl3n5bp23yng3naji0yw012a12xb2sa8kwdp2ln0qf8mcy"; + }) {} +}: +with nixpkgs; + +haskell.lib.buildStackProject { + inherit ghc; + name = "hs-abci"; + buildInputs = [ git hlint protobuf haskellPackages.stylish-haskell zlib ]; +} diff --git a/stack.yaml b/stack.yaml index 0ae12fca..5eac516f 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,6 +1,10 @@ # https://www.stackage.org/lts-13.27 resolver: lts-14.11 +nix: + #enabled: bool # defaults to true on nixos, false everywhere else + shell-file: shell-stack.nix + packages: - ./hs-abci-types - ./hs-tendermint-client