diff --git a/cachix-api.cabal b/cachix-api.cabal
--- a/cachix-api.cabal
+++ b/cachix-api.cabal
@@ -1,27 +1,38 @@
-cabal-version:      2.2
-name:               cachix-api
-version:            1.6
-synopsis:           Servant HTTP API specification for https://cachix.org
-homepage:           https://github.com/cachix/cachix#readme
-bug-reports:        https://github.com/cachix/cachix/issues
-author:             Domen Kozar
-maintainer:         domen@cachix.org
-copyright:          2018 Domen Kozar
-category:           Nix
-license:            Apache-2.0
-license-file:       LICENSE
-build-type:         Simple
-extra-source-files:
+cabal-version:   2.2
+name:            cachix-api
+version:         1.6.1
+synopsis:        Servant HTTP API specification for https://cachix.org
+homepage:        https://github.com/cachix/cachix#readme
+bug-reports:     https://github.com/cachix/cachix/issues
+author:          Domen Kozar
+maintainer:      domen@cachix.org
+copyright:       2018 Domen Kozar
+category:        Nix
+license:         Apache-2.0
+license-file:    LICENSE
+build-type:      Simple
+extra-doc-files:
   CHANGELOG.md
   README.md
 
+source-repository head
+  type:     git
+  location: https://github.com/cachix/cachix
+  subdir:   cachix-api
+
 common defaults
+  build-depends:      base >=4.7 && <5
   default-extensions:
     NoImplicitPrelude
+    NoImportQualifiedPost
     DeriveAnyClass
     DeriveGeneric
     DerivingVia
+    LambdaCase
+    NamedFieldPuns
     OverloadedStrings
+    RecordWildCards
+    ScopedTypeVariables
 
   ghc-options:
     -Wall -Wcompat -Wincomplete-record-updates
@@ -29,6 +40,16 @@
     -fwarn-unused-imports -fwarn-missing-signatures
     -fwarn-name-shadowing -fwarn-incomplete-patterns
 
+  -- TODO: address partial record fields in Cachix Deploy
+  -- if impl(ghc >= 8.4)
+  --   ghc-options:       -Wpartial-fields
+
+  if impl(ghc >=8.10)
+    ghc-options: -Wunused-packages
+
+  if impl(ghc >=9.2)
+    ghc-options: -Wredundant-bang-patterns
+
   default-language:   Haskell2010
 
 source-repository head
@@ -68,19 +89,13 @@
   build-depends:
     , aeson
     , async
-    , base                  >=4.7    && <5
-    , base16-bytestring
     , bytestring
     , conduit               >=1.3.0
-    , cookie
     , cryptonite
-    , deepseq
     , deriving-aeson
     , exceptions
-    , http-api-data
     , http-media
     , jose
-    , lens
     , memory
     , nix-narinfo
     , protolude
@@ -88,14 +103,10 @@
     , safe-exceptions
     , servant               >=0.14.1
     , servant-auth
-    , servant-auth-swagger
-    , servant-client
     , stm-chans
-    , string-conv
     , swagger2
     , text
     , time
-    , transformers
     , unordered-containers
     , uuid
     , websockets
@@ -111,28 +122,9 @@
   hs-source-dirs:     test
   build-depends:
     , aeson
-    , base                     >=4.7    && <5
-    , base16-bytestring
     , bytestring
     , cachix-api
-    , conduit                  >=1.3.0
-    , cookie
-    , cryptonite
     , hspec
-    , http-api-data
-    , http-media
-    , lens
-    , memory
     , protolude
-    , servant                  >=0.14.1
-    , servant-auth
-    , servant-auth-swagger
-    , servant-swagger
-    , servant-swagger-ui-core
-    , string-conv
-    , swagger2
-    , text
-    , transformers
-    , unordered-containers
 
   build-tool-depends: hspec-discover:hspec-discover
diff --git a/src/Cachix/API.hs b/src/Cachix/API.hs
--- a/src/Cachix/API.hs
+++ b/src/Cachix/API.hs
@@ -1,5 +1,4 @@
 {-# LANGUAGE DataKinds #-}
-{-# LANGUAGE DeriveGeneric #-}
 {-# LANGUAGE TypeOperators #-}
 
 module Cachix.API
@@ -27,7 +26,6 @@
 import Data.UUID (UUID)
 import Protolude
 import Servant.API hiding (BasicAuth)
-import Servant.API.Generic
 import Servant.Auth
 
 type CachixAuth = Auth '[Cookie, JWT, BasicAuth] Session
diff --git a/src/Cachix/API/Deploy/V1.hs b/src/Cachix/API/Deploy/V1.hs
--- a/src/Cachix/API/Deploy/V1.hs
+++ b/src/Cachix/API/Deploy/V1.hs
@@ -1,5 +1,4 @@
 {-# LANGUAGE DataKinds #-}
-{-# LANGUAGE DeriveGeneric #-}
 {-# LANGUAGE TypeOperators #-}
 
 module Cachix.API.Deploy.V1 where
@@ -11,7 +10,6 @@
 import Data.UUID (UUID)
 import Protolude
 import Servant.API
-import Servant.API.Generic
 
 type API = "api" :> "v1" :> ToServantApi DeployAPI
 
diff --git a/src/Cachix/API/Deploy/V2.hs b/src/Cachix/API/Deploy/V2.hs
--- a/src/Cachix/API/Deploy/V2.hs
+++ b/src/Cachix/API/Deploy/V2.hs
@@ -1,5 +1,4 @@
 {-# LANGUAGE DataKinds #-}
-{-# LANGUAGE DeriveGeneric #-}
 {-# LANGUAGE TypeOperators #-}
 
 module Cachix.API.Deploy.V2 where
@@ -9,7 +8,6 @@
 import qualified Cachix.Types.DeployResponse.V2 as DeployResponse.V2
 import Protolude
 import Servant.API
-import Servant.API.Generic
 
 type API = "api" :> "v2" :> ToServantApi DeployAPI
 
diff --git a/src/Cachix/API/Signing.hs b/src/Cachix/API/Signing.hs
--- a/src/Cachix/API/Signing.hs
+++ b/src/Cachix/API/Signing.hs
@@ -27,20 +27,20 @@
       ["1", storePath, narHash, show narSize, T.intercalate "," references]
 
 -- Useful sinks for streaming nars
-sizeSink :: MonadIO m => ConduitT ByteString o m Integer
+sizeSink :: (MonadIO m) => ConduitT ByteString o m Integer
 sizeSink = CC.foldM (\p n -> return (p + fromIntegral (BS.length n))) 0
 
-hashSink :: MonadIO m => ConduitT ByteString o m (Context SHA256)
+hashSink :: (MonadIO m) => ConduitT ByteString o m (Context SHA256)
 hashSink = CC.foldM (\p n -> return (hashUpdate p n)) hashInit
 
-passthroughSizeSink :: MonadIO m => IORef Integer -> ConduitT ByteString ByteString m ()
+passthroughSizeSink :: (MonadIO m) => IORef Integer -> ConduitT ByteString ByteString m ()
 passthroughSizeSink ioref = passthroughSink sizeSink (liftIO . writeIORef ioref)
 
-passthroughHashSinkBase :: MonadIO m => (Digest SHA256 -> ByteString) -> IORef ByteString -> ConduitT ByteString ByteString m ()
+passthroughHashSinkBase :: (MonadIO m) => (Digest SHA256 -> ByteString) -> IORef ByteString -> ConduitT ByteString ByteString m ()
 passthroughHashSinkBase f ioref = passthroughSink hashSink (liftIO . writeIORef ioref . f . hashFinalize)
 
-passthroughHashSink :: MonadIO m => IORef ByteString -> ConduitT ByteString ByteString m ()
+passthroughHashSink :: (MonadIO m) => IORef ByteString -> ConduitT ByteString ByteString m ()
 passthroughHashSink = passthroughHashSinkBase BA.convert
 
-passthroughHashSinkB16 :: MonadIO m => IORef ByteString -> ConduitT ByteString ByteString m ()
+passthroughHashSinkB16 :: (MonadIO m) => IORef ByteString -> ConduitT ByteString ByteString m ()
 passthroughHashSinkB16 = passthroughHashSinkBase (convertToBase Base16)
diff --git a/src/Cachix/API/WebSocketSubprotocol.hs b/src/Cachix/API/WebSocketSubprotocol.hs
--- a/src/Cachix/API/WebSocketSubprotocol.hs
+++ b/src/Cachix/API/WebSocketSubprotocol.hs
@@ -50,10 +50,10 @@
   | DeploymentFinished {id :: UUID, time :: UTCTime, hasSucceeded :: Bool}
   deriving (Show, Eq, Generic, Aeson.FromJSON, Aeson.ToJSON)
 
-parseMessage :: Aeson.FromJSON cmd => ByteString -> Either Text (Message cmd)
+parseMessage :: (Aeson.FromJSON cmd) => ByteString -> Either Text (Message cmd)
 parseMessage = first toS . Aeson.eitherDecodeStrict'
 
-sendMessage :: Aeson.ToJSON cmd => WS.Connection -> Message cmd -> IO ()
+sendMessage :: (Aeson.ToJSON cmd) => WS.Connection -> Message cmd -> IO ()
 sendMessage connection cmd =
   WS.sendTextData connection (Aeson.encode cmd)
 
diff --git a/src/Cachix/Types/BinaryCache.hs b/src/Cachix/Types/BinaryCache.hs
--- a/src/Cachix/Types/BinaryCache.hs
+++ b/src/Cachix/Types/BinaryCache.hs
@@ -6,6 +6,8 @@
 import Protolude
 import Servant.API
 
+type BinaryCacheName = Text
+
 data BinaryCache = BinaryCache
   { name :: Text,
     uri :: Text,
diff --git a/src/Cachix/Types/ContentTypes.hs b/src/Cachix/Types/ContentTypes.hs
--- a/src/Cachix/Types/ContentTypes.hs
+++ b/src/Cachix/Types/ContentTypes.hs
@@ -1,5 +1,6 @@
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
+{-# OPTIONS_GHC -Wno-orphans #-}
 
 module Cachix.Types.ContentTypes
   ( XNixNar,
diff --git a/test/DeploySpec.hs b/test/DeploySpec.hs
--- a/test/DeploySpec.hs
+++ b/test/DeploySpec.hs
@@ -3,7 +3,6 @@
 import Cachix.Types.Deploy
 import Data.Aeson (eitherDecode, encode)
 import qualified Data.ByteString.Lazy as BSL
-import Data.HashMap.Strict
 import Protolude
 import Test.Hspec
 import qualified Prelude
