From a146db6dcfa044197733645b285300b1e29692a3 Mon Sep 17 00:00:00 2001 From: seth Date: Thu, 14 Dec 2023 05:18:59 -0500 Subject: tf: add binary-cache cf rule --- tf/cloudflare/ruleset.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tf/cloudflare/ruleset.nix') diff --git a/tf/cloudflare/ruleset.nix b/tf/cloudflare/ruleset.nix index 1be98aa..7da114d 100644 --- a/tf/cloudflare/ruleset.nix +++ b/tf/cloudflare/ruleset.nix @@ -60,5 +60,22 @@ } ]; }; + + binary-cache = { + kind = "zone"; + name = "default"; + phase = "http_request_cache_settings"; + zone_id = lib.tfRef "var.zone_id"; + + rules = { + action = "set_cache_settings"; + action_parameters = { + cache = true; + }; + description = "nix cache"; + enabled = true; + expression = "(ssl and http.host eq \"cache.mydadleft.me\" and http.request.uri.query eq \"\" and ends_with(http.request.uri.path, \"nar\"))"; + }; + }; }; } -- cgit v1.2.3