diff --git a/.gitignore b/.gitignore
--- a/.gitignore
+++ b/.gitignore
@@ -29,4 +29,5 @@
 cabal.project.local
 .ghc.environment.*
 .hsenv
-result
+/result*
+/dist-newstyle
diff --git a/.travis.yml b/.travis.yml
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,28 +1,2 @@
-# Use new container infrastructure to enable caching
-sudo: false
-
-# Caching so the next build will be fast too.
-cache:
-  directories:
-  - $HOME/.stack
-
-# Choose a lightweight base image; we provide our own build tools.
-language: c
-
-# GHC depends on GMP. You can add other dependencies here as well.
-addons:
-  apt:
-    packages:
-    - libgmp-dev
-
-before_install:
-# Download and unpack the stack executable
-- mkdir -p ~/.local/bin
-- export PATH=$HOME/.local/bin:$PATH
-- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
-
-# This line does all of the work: installs GHC if necessary, build the library,
-# executables, and test suites, and runs the test suites. --no-terminal works
-# around some quirks in Travis's terminal implementation.
-script:
-- stack --no-terminal --install-ghc test
+language: nix
+script: nix build
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,4 +1,5 @@
 [![Build Status](https://travis-ci.org/lindenbaum/hinterface.svg?branch=master)](https://travis-ci.org/lindenbaum/hinterface)
+[![Hackage](https://img.shields.io/hackage/v/hinterface)](http://hackage.haskell.org/package/hinterface)
 
 # hinterface - Haskell / Erlang interoperability library
 
diff --git a/cabal.project b/cabal.project
new file mode 100644
--- /dev/null
+++ b/cabal.project
@@ -0,0 +1,1 @@
+packages: ./*.cabal
diff --git a/hinterface.cabal b/hinterface.cabal
--- a/hinterface.cabal
+++ b/hinterface.cabal
@@ -1,113 +1,135 @@
-cabal-version: >=1.22
-name: hinterface
-version: 2.0.0
-license: BSD3
-license-file: LICENSE
-copyright: 2016-2020 Timo Koepke, Sven Heyll
-maintainer: timo.koepke@googlemail.com, sven.heyll@gmail.com
-author: Timo Koepke, Sven Heyll
-homepage: https://github.com/lindenbaum/hinterface
-synopsis: Haskell / Erlang interoperability library
-description:
-    A library for building nodes of a distributed Erlang system in Haskell.
-    Nodes can be created and registered to an epmd, Erlang terms can be
-    marshalled to/from Erlangs binary term representation and message can
-    be sent to or received from processes running on a different node.
-    In it's preliminary state hinterface supports of Erlangs binary terms
-    and a subset of the distribution protocol.
-category: Language
-build-type: Simple
-extra-source-files:
-    README.md
-    stack.yaml
-    .travis.yml
-    Setup.hs
-    .gitignore
+name:                hinterface
+version:             2.0.1
+synopsis:            Haskell / Erlang interoperability library
+description:         A library for building nodes of a distributed Erlang system in Haskell.
 
-source-repository head
-    type: git
-    location: https://github.com/lindenbaum/hinterface.git
+                     Nodes can be created and registered to an epmd, Erlang terms can be
+                     marshalled to/from Erlangs binary term representation and message can
+                     be sent to or received from processes running on a different node.
 
+                     In it's preliminary state hinterface supports of Erlangs binary terms
+                     and a subset of the distribution protocol.
+
+homepage:            https://github.com/lindenbaum/hinterface
+license:             BSD3
+license-file:        LICENSE
+author:              Timo Koepke, Sven Heyll
+maintainer:          timo.koepke@googlemail.com, sven.heyll@gmail.com
+copyright:           2016-2020 Timo Koepke, Sven Heyll
+category:            Language
+build-type:          Simple
+extra-source-files:  README.md, .travis.yml, Setup.hs, .gitignore, cabal.project
+cabal-version:       >=1.22
+
 library
-    exposed-modules:
-        Util.IOExtra
-        Util.BufferedIOx
-        Util.Socket
-        Network.BufferedSocket
-        Util.Binary
-        Util.FloatCast
-        Foreign.Erlang.NodeState
-        Foreign.Erlang.NodeData
-        Foreign.Erlang.Epmd
-        Foreign.Erlang.Digest
-        Foreign.Erlang.Handshake
-        Foreign.Erlang.Term
-        Foreign.Erlang.LocalNode
-        Foreign.Erlang.ControlMessage
-        Foreign.Erlang.Mailbox
-        Foreign.Erlang.Connection
-    hs-source-dirs: src
-    default-language: Haskell2010
-    default-extensions: OverloadedStrings NamedFieldPuns
-                        FlexibleContexts PatternSynonyms ViewPatterns
-    ghc-options: -Wall -funbox-strict-fields
-    build-depends:
-        QuickCheck >=2.11 && <2.14,
-        array >=0.5.2.0 && <0.6,
-        async >=2.2.1 && <2.3,
-        base >=4.12 && <5,
-        binary >=0.8.5.1 && <0.9,
-        bytestring >=0.10.8.2 && <0.11,
-        containers >=0.5.11.0 && <0.7,
-        cryptonite ==0.26.*,
-        deepseq ==1.4.*,
-        exceptions >=0.10.0 && <0.11,
-        lifted-async >=0.10.0.2 && <0.11,
-        lifted-base >=0.2.3.12 && <0.3,
-        memory ==0.15.*,
-        monad-control >=1.0.2.3 && <1.1,
-        monad-logger >=0.3.29 && <0.4,
-        mtl >=2.2.2 && <2.3,
-        network ==3.1.1.*,
-        random ==1.1.*,
-        resourcet >=1.2.1 && <1.3,
-        safe-exceptions >=0.1.7.0 && <0.2,
-        stm >=2.4.5.0 && <2.6,
-        text >=1.2.3.0 && <1.3,
-        transformers >=0.5.5.0 && <0.6,
-        transformers-base >=0.4.5.2 && <0.5,
-        vector >=0.12.0.1 && <0.13
+  hs-source-dirs:      src
+  exposed-modules:     Util.IOExtra
+                     , Util.BufferedIOx
+                     , Util.Socket
+                     , Network.BufferedSocket
+                     , Util.Binary
+                     , Util.FloatCast
+                     , Foreign.Erlang.NodeState
+                     , Foreign.Erlang.NodeData
+                     , Foreign.Erlang.Epmd
+                     , Foreign.Erlang.Digest
+                     , Foreign.Erlang.Handshake
+                     , Foreign.Erlang.Term
+                     , Foreign.Erlang.LocalNode
+                     , Foreign.Erlang.ControlMessage
+                     , Foreign.Erlang.Mailbox
+                     , Foreign.Erlang.Connection
+  default-extensions:  OverloadedStrings
+                     , NamedFieldPuns
+                     , FlexibleContexts
+                     , PatternSynonyms
+                     , ViewPatterns
+  ghc-options:         -Wall -funbox-strict-fields
+  build-depends:       QuickCheck >=2.11 && <2.14
+                     , array >=0.5.2.0 && <0.6
+                     , async >=2.2.1 && <2.3
+                     , base >= 4.12 && < 5
+                     , binary >=0.8.5.1 && <0.9
+                     , bytestring >=0.10.8.2 && <0.11
+                     , containers >=0.5.11.0 && <0.7
+                     , cryptonite == 0.26.*
+                     , deepseq >= 1.4 && <1.5
+                     , exceptions >=0.10.0 && <0.11
+                     , lifted-async >=0.10.0.2 && <0.11
+                     , lifted-base >=0.2.3.12 && <0.3
+                     , memory == 0.15.*
+                     , monad-control >=1.0.2.3 && <1.1
+                     , monad-logger >=0.3.29 && <0.4
+                     , mtl >=2.2.2 && <2.3
+                     , network == 3.1.1.*
+                     , random ==1.1.*
+                     , resourcet >=1.2.1 && <1.3
+                     , safe-exceptions >=0.1.7.0 && <0.2
+                     , stm >=2.4.5.0 && <2.6
+                     , text >=1.2.3.0 && <1.3
+                     , transformers >=0.5.5.0 && <0.6
+                     , transformers-base >=0.4.5.2 && <0.5
+                     , vector >=0.12.0.1 && <0.13
 
+  default-language:    Haskell2010
+
 test-suite hinterface-test
-    type: exitcode-stdio-1.0
-    main-is: Spec.hs
-    hs-source-dirs: test
-    other-modules:
-        Foreign.Erlang.NodeDataSpec
-        Foreign.Erlang.HandshakeSpec
-        Foreign.Erlang.ControlMessageSpec
-        Foreign.Erlang.TermSpec
-        Foreign.Erlang.Term2Experimental
-    default-language: Haskell2010
-    default-extensions: AllowAmbiguousTypes ConstraintKinds DataKinds
-                        DeriveFoldable DeriveFunctor DeriveGeneric DeriveTraversable
-                        ExistentialQuantification FlexibleContexts FlexibleInstances
-                        FunctionalDependencies GADTs GeneralizedNewtypeDeriving
-                        KindSignatures LambdaCase MultiParamTypeClasses NamedFieldPuns
-                        OverloadedLists OverloadedStrings PatternSynonyms RankNTypes
-                        ScopedTypeVariables StandaloneDeriving TemplateHaskell
-                        TupleSections TypeApplications TypeFamilies TypeInType
-                        TypeOperators ViewPatterns
-    other-extensions: CPP IncoherentInstances Strict StrictData
-    ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N
-    build-depends:
-        QuickCheck >=2.11.3 && <2.14,
-        async >=2.2.2,
-        base >=4.12 && <5,
-        binary >=0.8.7.0,
-        bytestring >=0.10.10.0,
-        hinterface -any,
-        hspec >=2.4 && <2.8,
-        monad-logger >=0.3.32,
-        transformers >=0.5.6.2,
-        vector >=0.12.1.2
+  type:                exitcode-stdio-1.0
+  hs-source-dirs:      test
+  main-is:             Spec.hs
+  build-depends:       QuickCheck >=2.11.3 && <2.14
+                     , async
+                     , base >= 4.12 && < 5
+                     , binary
+                     , bytestring
+                     , hinterface
+                     , hspec >= 2.4 && < 4
+                     , monad-logger
+                     , transformers
+                     , vector
+  build-tool-depends: hspec-discover:hspec-discover
+  other-modules:       Foreign.Erlang.NodeDataSpec
+                     , Foreign.Erlang.HandshakeSpec
+                     , Foreign.Erlang.ControlMessageSpec
+                     , Foreign.Erlang.TermSpec
+                     , Foreign.Erlang.Term2Experimental
+  default-extensions:  AllowAmbiguousTypes
+                     , ConstraintKinds
+                     , DataKinds
+                     , DeriveFoldable
+                     , DeriveFunctor
+                     , DeriveGeneric
+                     , DeriveTraversable
+                     , ExistentialQuantification
+                     , FlexibleContexts
+                     , FlexibleInstances
+                     , FunctionalDependencies
+                     , GADTs
+                     , GeneralizedNewtypeDeriving
+                     , KindSignatures
+                     , LambdaCase
+                     , MultiParamTypeClasses
+                     , NamedFieldPuns
+                     , OverloadedLists
+                     , OverloadedStrings
+                     , PatternSynonyms
+                     , RankNTypes
+                     , ScopedTypeVariables
+                     , StandaloneDeriving
+                     , TemplateHaskell
+                     , TupleSections
+                     , TypeApplications
+                     , TypeFamilies
+                     , TypeInType
+                     , TypeOperators
+                     , ViewPatterns
+  other-extensions:    CPP
+                     , IncoherentInstances
+                     , Strict
+                     , StrictData
+  ghc-options:         -Wall -threaded -rtsopts -with-rtsopts=-N
+  default-language:    Haskell2010
+
+source-repository head
+  type:     git
+  location: https://github.com/lindenbaum/hinterface.git
diff --git a/stack.yaml b/stack.yaml
deleted file mode 100644
--- a/stack.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-flags: {}
-extra-package-dbs: []
-packages:
-- .
-pvp-bounds: lower
-extra-deps: []
-resolver: lts-15.12
