diff --git a/.circleci/config.yml b/.circleci/config.yml
index 97951fea83adcbdf052d8ddb6e67598a2cad3f7d..726b0fe6d82b93a035cdd0451d6880e27f75ca64 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -25,14 +25,14 @@ jobs:
     resource_class: "xlarge"
 
     environment:
-      NIX_CONFIG: |
-        # Add privatestorage's and haskell.nix[1] nix caches for builds.  [1]
-        # https://input-output-hk.github.io/haskell.nix/tutorials/getting-started/#setting-up-the-binary-cache
-        extra-substituters = http://saxtons.private.storage/ https://hydra.iohk.io/
-        # We needed to explictly specify the key for cache.nixos.org until we
-        # are using a version of nix that has
-        # https://github.com/NixOS/nix/commit/ff4dea63c9403880500f82ce273713ecf793d2d9
-        extra-trusted-public-keys = saxtons.private.storage:MplOcEH8G/6mRlhlKkbA8GdeFR3dhCFsSszrspE/ZwY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
+      # Add privatestorage's and haskell.nix[1] nix caches for builds.  [1]
+      # https://input-output-hk.github.io/haskell.nix/tutorials/getting-started/#setting-up-the-binary-cache
+      EXTRA_SUBSTITUTERS: "--extra-substituters='http://saxtons.private.storage/ https://hydra.iohk.io/'"
+
+      # We needed to explictly specify the key for cache.nixos.org until we
+      # are using a version of nix that has
+      # https://github.com/NixOS/nix/commit/ff4dea63c9403880500f82ce273713ecf793d2d9
+      EXTRA_TRUSTED_PUBLIC_KEYS: "--extra-trusted-public-keys='saxtons.private.storage:MplOcEH8G/6mRlhlKkbA8GdeFR3dhCFsSszrspE/ZwY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ='"
 
     steps:
       # Get *our* source code.
@@ -71,6 +71,8 @@ jobs:
             nix-build \
               -vvvv \
               --debug \
+              "${EXTRA_SUBSTITUTERS}" \
+              "${EXTRA_TRUSTED_PUBLIC_KEYS}" \
               -j 4 \
               ./nix/ \
               -A PaymentServer.components.exes."PaymentServer-exe"
@@ -79,6 +81,8 @@ jobs:
           name: "Building Tests"
           command: |
             nix-build \
+              "${EXTRA_SUBSTITUTERS}" \
+              "${EXTRA_TRUSTED_PUBLIC_KEYS}" \
               -j 4 \
               ./nix/ \
               -A PaymentServer.components.tests."PaymentServer-tests"