2023-12-04 00:39:58 +02:00
|
|
|
{ config, depot, ... }:
|
|
|
|
|
2023-06-14 00:27:53 +03:00
|
|
|
{
|
|
|
|
services.attic = {
|
|
|
|
nodes = {
|
2024-08-02 23:46:45 +03:00
|
|
|
monolith = [ "VEGAS" "prophet" ];
|
|
|
|
server = [ "VEGAS" "grail" "prophet" ];
|
2023-06-14 00:27:53 +03:00
|
|
|
};
|
|
|
|
nixos = {
|
2024-08-02 23:46:45 +03:00
|
|
|
monolith = [
|
|
|
|
./server.nix
|
|
|
|
];
|
2023-06-16 18:12:38 +03:00
|
|
|
server = [
|
|
|
|
./server.nix
|
|
|
|
./binary-cache.nix
|
|
|
|
./nar-serve.nix
|
|
|
|
];
|
2023-06-14 00:27:53 +03:00
|
|
|
};
|
2024-08-02 23:46:45 +03:00
|
|
|
meshLinks.server = {
|
|
|
|
name = "attic";
|
|
|
|
link.protocol = "http";
|
|
|
|
};
|
2024-07-08 20:00:55 +03:00
|
|
|
secrets = let
|
|
|
|
inherit (config.services.attic) nodes;
|
|
|
|
in {
|
|
|
|
serverToken = {
|
|
|
|
nodes = nodes.server;
|
|
|
|
};
|
|
|
|
dbCredentials = {
|
|
|
|
nodes = nodes.server;
|
|
|
|
owner = "atticd";
|
|
|
|
};
|
|
|
|
};
|
2023-06-14 00:27:53 +03:00
|
|
|
};
|
2023-10-31 23:19:08 +02:00
|
|
|
|
2024-07-23 20:03:56 +03:00
|
|
|
garage = config.lib.forService "attic" {
|
2024-07-11 00:54:07 +03:00
|
|
|
keys.attic.locksmith = {
|
|
|
|
nodes = config.services.attic.nodes.server;
|
|
|
|
owner = "atticd";
|
|
|
|
format = "aws";
|
|
|
|
};
|
2023-10-31 23:19:08 +02:00
|
|
|
buckets.attic = {
|
|
|
|
allow.attic = [ "read" "write" ];
|
|
|
|
};
|
|
|
|
};
|
2023-12-04 00:39:58 +02:00
|
|
|
|
|
|
|
dns.records = let
|
|
|
|
serverAddrs = map
|
|
|
|
(node: depot.hours.${node}.interfaces.primary.addrPublic)
|
|
|
|
config.services.attic.nodes.server;
|
2024-07-23 20:03:56 +03:00
|
|
|
in config.lib.forService "attic" {
|
2023-12-04 00:39:58 +02:00
|
|
|
cache.target = serverAddrs;
|
|
|
|
};
|
2024-08-02 23:46:45 +03:00
|
|
|
|
2024-07-23 20:03:56 +03:00
|
|
|
ways = config.lib.forService "attic" {
|
|
|
|
cache-api = {
|
|
|
|
consulService = "atticd";
|
|
|
|
extras.extraConfig = ''
|
|
|
|
client_max_body_size 4G;
|
|
|
|
'';
|
|
|
|
};
|
2024-08-02 23:46:45 +03:00
|
|
|
};
|
2023-06-14 00:27:53 +03:00
|
|
|
}
|