From a8342874ec75f68e554bf46b6c42d4f0d3c177ba Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Mon, 16 Sep 2019 08:58:40 -0400
Subject: [PATCH] try using run and checksum to avoid the duplication

---
 .circleci/config.yml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/.circleci/config.yml b/.circleci/config.yml
index 841103e..ebf3d46 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -49,6 +49,11 @@ jobs:
       # Get *our* source code.
       - "checkout"
 
+      - "run":
+          name: "Prepare For Cache Key"
+          command: |
+            echo "${NIXPKGS_REV}" > nixpkgs.rev
+
       - restore_cache:
           # Get all of Nix's state relating to the particular revision of
           # nixpkgs we're using.  It will always be the same.  CircleCI
@@ -76,8 +81,8 @@ jobs:
             # Note: The literal hash here must match NIXPKGS_REV set above.
             # CircleCI doesn't let us interpolate that value so we *duplicate*
             # it instead.
-            - paymentserver-nix-store-v1-3c83ad6ac13b67101cc3e2e07781963a010c1624-{{ checksum "ristretto.nix" }}
-            - paymentserver-nix-store-v1-3c83ad6ac13b67101cc3e2e07781963a010c1624-
+            - paymentserver-nix-store-v1-{{ checksum "nixpkgs.rev" }}-{{ checksum "ristretto.nix" }}
+            - paymentserver-nix-store-v1-{{ checksum "nixpkgs.rev" }}-
             - paymentserver-nix-store-v1-
 
       - restore_cache:
-- 
GitLab