2022-11-03 20:49:26 +01:00
|
|
|
{ config, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
system.stateVersion = "22.05";
|
|
|
|
|
2022-12-18 22:16:29 +01:00
|
|
|
c3d2 = {
|
|
|
|
deployment.server = "server10";
|
|
|
|
hq.statistics.enable = true;
|
2022-11-03 20:49:26 +01:00
|
|
|
};
|
|
|
|
microvm = {
|
2022-11-17 00:01:22 +01:00
|
|
|
vcpu = 8;
|
2023-08-10 23:29:56 +02:00
|
|
|
mem = 20 * 1024;
|
2022-11-03 20:49:26 +01:00
|
|
|
};
|
|
|
|
|
2022-12-20 04:55:17 +01:00
|
|
|
networking = {
|
|
|
|
hostName = "caveman";
|
|
|
|
firewall.allowedTCPPorts = [ 23 ];
|
|
|
|
};
|
2022-11-03 20:49:26 +01:00
|
|
|
|
2022-11-06 13:53:33 +01:00
|
|
|
services.journald.extraConfig = ''
|
|
|
|
Storage=volatile
|
|
|
|
'';
|
|
|
|
|
2023-08-09 00:27:12 +02:00
|
|
|
sops = {
|
|
|
|
defaultSopsFile = ./secrets.yaml;
|
|
|
|
secrets = {
|
|
|
|
"restic/password".owner = "root";
|
2023-08-09 00:44:53 +02:00
|
|
|
"restic/repositories/server8".owner = "root";
|
2023-10-12 21:54:05 +02:00
|
|
|
"redis/caveman/requirePass".mode = "0444";
|
2023-08-09 00:27:12 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-01-06 23:57:20 +01:00
|
|
|
services = {
|
2023-10-12 21:54:05 +02:00
|
|
|
redis.servers.caveman = {
|
|
|
|
# Listen on the public network
|
|
|
|
bind = null;
|
|
|
|
# Override default backup schedule to reduce I/O
|
|
|
|
save = [
|
|
|
|
# Every 2h if at least 1 entry changed
|
|
|
|
[ 7200 1 ]
|
|
|
|
# Every 30min if at least 10000 entries changed
|
|
|
|
[ 1800 10000 ]
|
|
|
|
];
|
|
|
|
};
|
2023-03-31 20:21:22 +02:00
|
|
|
|
2023-01-06 23:57:20 +01:00
|
|
|
caveman = {
|
2023-10-12 21:54:05 +02:00
|
|
|
redis = {
|
|
|
|
# leave 4 GB for caveman services
|
|
|
|
maxmemory = (config.microvm.mem - 4) * 1024 * 1024;
|
|
|
|
passwordFile = config.sops.secrets."redis/caveman/requirePass".path;
|
|
|
|
};
|
2022-11-03 20:49:26 +01:00
|
|
|
|
2023-01-06 23:57:20 +01:00
|
|
|
hunter = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
2023-04-24 21:43:26 +02:00
|
|
|
prometheus_port = 9103;
|
2023-01-06 23:57:20 +01:00
|
|
|
max_workers = 384;
|
|
|
|
hosts = with builtins;
|
2023-10-12 21:23:35 +02:00
|
|
|
filter (line: isString line && line != "") (
|
2023-01-06 23:57:20 +01:00
|
|
|
split "\n" (
|
|
|
|
readFile ./mastodon-instances.txt
|
|
|
|
)
|
|
|
|
);
|
|
|
|
};
|
2022-11-03 20:49:26 +01:00
|
|
|
};
|
2023-01-22 21:03:23 +01:00
|
|
|
butcher.enable = true;
|
2023-01-06 23:57:20 +01:00
|
|
|
gatherer.enable = true;
|
|
|
|
smokestack.enable = true;
|
2022-11-03 20:49:26 +01:00
|
|
|
};
|
|
|
|
|
2023-01-06 23:57:20 +01:00
|
|
|
nginx = {
|
2022-11-16 00:50:26 +01:00
|
|
|
enable = true;
|
|
|
|
virtualHosts."fedi.buzz" = {
|
|
|
|
default = true;
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
serverAliases = [
|
|
|
|
"www.fedi.buzz"
|
|
|
|
"caveman.flpk.zentralwerk.org"
|
|
|
|
];
|
|
|
|
locations."/".proxyPass = "http://127.0.0.1:${toString config.services.caveman.gatherer.settings.listen_port}/";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2022-11-03 20:49:26 +01:00
|
|
|
}
|