nixfiles/config/hosts/florp/configuration.nix

69 lines
1.6 KiB
Nix
Raw Permalink Normal View History

{ lib, config, pkgs, ... }: {
2024-11-04 21:19:57 +01:00
imports = [
../../common
../../profiles/headless.nix
../../profiles/kartoffel.nix
../../profiles/lxc.nix
../../services/akkoma
../../services/nginx.nix
];
networking = {
hostName = "florp";
domain = lib.mkForce "social";
};
2024-11-13 16:03:28 +01:00
systemd.network.networks."98-eth-default" = {
address = [
"2a0f:be01:0:100::171/128"
];
};
2024-11-08 14:49:21 +01:00
2024-11-13 16:03:28 +01:00
kyouma.nginx.defaultForbidden = "florp.social";
kyouma.restic = let
pgBackup = "/var/cache/postgresql.sql";
in {
2024-11-08 14:49:21 +01:00
enable = true;
remoteUser = "zh3485s1";
2024-11-09 22:05:02 +01:00
timerConfig = {
OnCalendar = "hourly";
Persistent = true;
};
2024-11-08 14:49:21 +01:00
paths = [
"/var/lib/akkoma"
2024-11-09 22:05:02 +01:00
"/var/lib/secrets"
pgBackup
2024-11-08 14:49:21 +01:00
];
backupPrepareCommand = ''
umask 0077
rm -f -- ${pgBackup}
${pkgs.su}/bin/su -c '${lib.getExe' config.services.postgresql.package "pg_dumpall"}' \
${config.services.postgresql.superUser} >${pgBackup}
'';
backupCleanupCommand = ''
rm -f -- ${pgBackup}
'';
2024-11-08 14:49:21 +01:00
};
2024-11-04 21:19:57 +01:00
services.postgresql.settings = {
2024-11-08 14:49:21 +01:00
max_connections = 128;
2024-11-04 21:19:57 +01:00
shared_buffers = "4GB";
effective_cache_size = "12GB";
maintenance_work_mem = "1GB";
checkpoint_completion_target = 0.9;
wal_buffers = "16MB";
default_statistics_target = 100;
random_page_cost = 1.1;
effective_io_concurrency = 200;
work_mem = "34952kB";
huge_pages = "try";
min_wal_size = "2GB";
max_wal_size = "8GB";
max_worker_processes = 16;
max_parallel_workers_per_gather = 4;
max_parallel_workers = 16;
max_parallel_maintenance_workers = 4;
};
system.stateVersion = "24.11";
}