From 8d7fe21ab6b449983deb7bd9cb3b175dce60f226 Mon Sep 17 00:00:00 2001 From: zmrocze Date: Thu, 4 Jan 2024 23:30:07 +0100 Subject: [PATCH] Push to public cache --- ci/default.nix | 14 +++- flake.lock | 170 +++++++++++++++++++++++++------------------------ flake.nix | 7 +- 3 files changed, 107 insertions(+), 84 deletions(-) diff --git a/ci/default.nix b/ci/default.nix index 43be2f5..e1c98a0 100644 --- a/ci/default.nix +++ b/ci/default.nix @@ -1,6 +1,18 @@ {inputs, ...}: { imports = [ inputs.hercules-ci-effects.flakeModule + "${inputs.hercules-ci-effects}/effects/push-cache/default.nix" ]; - config.herculesCI.ciSystems = ["x86_64-linux" "x86_64-darwin"]; + herculesCI.ciSystems = ["x86_64-linux" "x86_64-darwin"]; + push-cache-effect = { + enable = true; + attic-client-pkg = inputs.attic.packages.x86_64-linux.attic-client; + caches = { + mlabs-cardano-nix = { + type = "attic"; + secretName = "cardano-nix-cache-push-token"; + packages = [inputs.nixpkgs.legacyPackages.x86_64-linux.hello]; + }; + }; + }; } diff --git a/flake.lock b/flake.lock index 3a55c3c..e933e10 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,50 @@ { "nodes": { + "attic": { + "inputs": { + "crane": "crane", + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1704159259, + "narHash": "sha256-OOEFibN9JQBepVeqxSNSBr6JUmdoZiH263ogms2jk0k=", + "owner": "zhaofengli", + "repo": "attic", + "rev": "e6bedf1869f382cfc51b69848d6e09d51585ead6", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "repo": "attic", + "type": "github" + } + }, + "crane": { + "inputs": { + "nixpkgs": [ + "attic", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1702918879, + "narHash": "sha256-tWJqzajIvYcaRWxn+cLUB9L9Pv4dQ3Bfit/YjU5ze3g=", + "owner": "ipetkov", + "repo": "crane", + "rev": "7195c00c272fdd92fc74e7d5a0a2844b9fadb2fb", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, "devour-flake": { "flake": false, "locked": { @@ -37,6 +82,22 @@ "type": "github" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -56,27 +117,9 @@ } }, "flake-parts_2": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib_2" - }, - "locked": { - "lastModified": 1688466019, - "narHash": "sha256-VeM2akYrBYMsb4W/MmBo1zmaMfgbL4cH3Pu8PGyIwJ0=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "8e8d955c22df93dbe24f19ea04f47a74adbdc5ec", - "type": "github" - }, - "original": { - "id": "flake-parts", - "type": "indirect" - } - }, - "flake-parts_3": { "inputs": { "nixpkgs-lib": [ "hercules-ci-effects", - "hercules-ci-agent", "nixpkgs" ] }, @@ -89,9 +132,8 @@ "type": "github" }, "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" + "id": "flake-parts", + "type": "indirect" } }, "flake-root": { @@ -109,68 +151,48 @@ "type": "github" } }, - "haskell-flake": { + "flake-utils": { "locked": { - "lastModified": 1684780604, - "narHash": "sha256-2uMZsewmRn7rRtAnnQNw1lj0uZBMh4m6Cs/7dV5YF08=", - "owner": "srid", - "repo": "haskell-flake", - "rev": "74210fa80a49f1b6f67223debdbf1494596ff9f2", + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "type": "github" }, "original": { - "owner": "srid", - "ref": "0.3.0", - "repo": "haskell-flake", - "type": "github" - } - }, - "hercules-ci-agent": { - "inputs": { - "flake-parts": "flake-parts_3", - "haskell-flake": "haskell-flake", - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1688568579, - "narHash": "sha256-ON0M56wtY/TIIGPkXDlJboAmuYwc73Hi8X9iJGtxOhM=", - "owner": "hercules-ci", - "repo": "hercules-ci-agent", - "rev": "367dd8cd649b57009a6502e878005a1e54ad78c5", + "owner": "numtide", + "repo": "flake-utils", "type": "github" - }, - "original": { - "id": "hercules-ci-agent", - "type": "indirect" } }, "hercules-ci-effects": { "inputs": { "flake-parts": "flake-parts_2", - "hercules-ci-agent": "hercules-ci-agent", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1697031886, - "narHash": "sha256-oTMPX8dGC7yxSwrbF4NuPNQsUEcHB1dusW2yEbFD5zg=", - "owner": "hercules-ci", + "lastModified": 1704313596, + "narHash": "sha256-qygHBNtVOoAMU84jFcqzI73eT2wzAXOLc/ZjZbnzAd8=", + "owner": "mlabs-haskell", "repo": "hercules-ci-effects", - "rev": "178b36dc3a75c96efc25477d45eafc37ba1fafc3", + "rev": "e464c123d89a634dd4973b5c17b5a11cb7ea8fb0", "type": "github" }, "original": { - "owner": "hercules-ci", + "owner": "mlabs-haskell", + "ref": "push-cache-effect", "repo": "hercules-ci-effects", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1688322751, - "narHash": "sha256-eW62dC5f33oKZL7VWlomttbUnOTHrAbte9yNUNW8rbk=", + "lastModified": 1704194953, + "narHash": "sha256-RtDKd8Mynhe5CFnVT8s0/0yqtWFMM9LmCzXv/YKxnq4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0fbe93c5a7cac99f90b60bdf5f149383daaa615f", + "rev": "bd645e8668ec6612439a9ee7e71f7eac4099d4f6", "type": "github" }, "original": { @@ -198,40 +220,23 @@ "type": "github" } }, - "nixpkgs-lib_2": { + "nixpkgs-stable": { "locked": { - "dir": "lib", - "lastModified": 1688049487, - "narHash": "sha256-100g4iaKC9MalDjUW9iN6Jl/OocTDtXdeAj7pEGIRh4=", + "lastModified": 1702780907, + "narHash": "sha256-blbrBBXjjZt6OKTcYX1jpe9SRof2P9ZYWPzq22tzXAA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4bc72cae107788bf3f24f30db2e2f685c9298dc9", + "rev": "1e2e384c5b7c50dbf8e9c441a9e58d85f408b01f", "type": "github" }, "original": { - "dir": "lib", "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixos-23.11", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_2": { - "locked": { - "lastModified": 1689393711, - "narHash": "sha256-l3gyTPy/qWLDk1CY1EgYwlsxcGxN2aVd7MlCzQa69rk=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "27fcd46fa18df36d270174246e7bd8f1787129ff", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { "locked": { "lastModified": 1697059129, "narHash": "sha256-9NJcFF9CEYPvHJ5ckE8kvINvI84SZZ87PvqMbH6pro0=", @@ -249,12 +254,13 @@ }, "root": { "inputs": { + "attic": "attic", "devour-flake": "devour-flake", "devshell": "devshell", "flake-parts": "flake-parts", "flake-root": "flake-root", "hercules-ci-effects": "hercules-ci-effects", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_2", "treefmt-nix": "treefmt-nix" } }, diff --git a/flake.nix b/flake.nix index 9b1ef61..6ef457f 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,12 @@ flake-parts.url = "github:hercules-ci/flake-parts"; # we use effects for CI and documentation - hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects"; + hercules-ci-effects.url = "github:mlabs-haskell/hercules-ci-effects/push-cache-effect"; + + attic = { + url = "github:zhaofengli/attic"; + inputs.nixpkgs.follows = "nixpkgs"; + }; # Utilities devshell = {