summaryrefslogtreecommitdiff
path: root/systems/atlas/attic.nix
blob: fe4e67caaebd68cd14da869bf20751361bf66db3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{
  config,
  secretsDir,
  ...
}: {
  age.secrets.atticCreds.file = secretsDir + "/atticCreds.age";

  services.atticd = {
    enable = true;
    credentialsFile = config.age.secrets.atticCreds.path;

    settings = {
      listen = "[::]:5000";
      api-endpoint = "https://cache.${config.networking.domain}/";

      compression.type = "zstd";

      chunking = let
        kb = 1024;
      in {
        nar-size-threshold = 64 * kb;
        min-size = 16 * kb;
        avg-size = 64 * kb;
        max-size = 256 * kb;
      };

      database = {
        type = "s3";
        region = "us-west-004";
        bucket = "getchoo-attic";
        endpoint = "s3.us-west-004.backblazeb2.com";
      };

      garbage-collection.interval = "12 hours";
    };
  };
}