From fe59bab239830b65c963ab9a4894611d2d2216f3 Mon Sep 17 00:00:00 2001 From: notohh Date: Wed, 20 Sep 2023 18:23:28 -0400 Subject: [PATCH] attic: init s3 storage --- hosts/sakura/services/atticd.nix | 15 +++++++++++++-- hosts/sakura/services/default.nix | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/hosts/sakura/services/atticd.nix b/hosts/sakura/services/atticd.nix index aa142d2..b8ec7ec 100644 --- a/hosts/sakura/services/atticd.nix +++ b/hosts/sakura/services/atticd.nix @@ -1,9 +1,10 @@ {config, ...}: { sops.secrets.attic-secret = {}; - + sops.secrets.s3-keyid = {}; + sops.secrets.s3-secret-key = {}; services.atticd = { enable = true; - credentialsFile = "/etc/attic/atticd.env"; + credentialsFile = config.sops.secrets.attic-secret.path; settings = { listen = "[::]:8100"; allowed-hosts = ["cache.notohh.dev"]; @@ -19,6 +20,16 @@ max-size = 256 * 1024; # 256 KiB }; + storage = { + type = "s3"; + region = "auto"; + bucket = "notoh-binary-cache"; + endpoint = "https://s3.us-east-005.backblazeb2.com/"; + credentials = { + access_key_id = config.sops.secrets.s3-keyid.path; + secret_access_key = config.sops.secrets.s3-secret-key.path; + }; + }; garbage-collection = { interval = "12 hours"; default-retention-period = "2 weeks"; diff --git a/hosts/sakura/services/default.nix b/hosts/sakura/services/default.nix index a5ca33f..64727fc 100644 --- a/hosts/sakura/services/default.nix +++ b/hosts/sakura/services/default.nix @@ -1,5 +1,6 @@ {...}: { imports = [ + ./atticd.nix ./traefik.nix ./authelia.nix ./hugo.nix