All checks were successful
Check flake.lock / Check health of `flake.lock` (pull_request) Successful in 16s
Check Nix formatting / Perform Nix format checks (pull_request) Successful in 2m51s
Check Nix flake / Perform Nix flake checks (ubuntu-latest) (pull_request) Successful in 12m15s
Check Nix flake / Build nix outputs (ubuntu-latest) (pull_request) Successful in 16m0s
This reverts commit 9b42a703d28cc2ebc89b9265a4f0328bd373eb20. Closes #47
63 lines
1.5 KiB
Nix
63 lines
1.5 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
# sudo -u postgres vacuumdb --all --analyze-in-stages
|
|
# /var/lib/postgresql/16/delete_old_cluster.sh
|
|
let
|
|
vars = import ./vars.nix;
|
|
dataDir = "${vars.primary_db}/postgresql/nix/${config.services.postgresql.package.psqlSchema}";
|
|
backupLocation = "${vars.primary_db}/postgresql/nix_backups";
|
|
in
|
|
{
|
|
services = {
|
|
postgresql = {
|
|
inherit dataDir;
|
|
enable = true;
|
|
enableJIT = true;
|
|
package = pkgs.postgresql_16;
|
|
identMap = ''
|
|
# ArbitraryMapName systemUser DBUser
|
|
superuser_map root postgres
|
|
superuser_map alice postgres
|
|
# Let other names login as themselves
|
|
superuser_map /^(.*)$ \1
|
|
'';
|
|
|
|
# initialScript = config.sops.secrets."postgres/init".path;
|
|
ensureDatabases = [ "atticd" ];
|
|
ensureUsers = [
|
|
{
|
|
name = "atticd";
|
|
ensureDBOwnership = true;
|
|
}
|
|
];
|
|
|
|
refreshCollation = true;
|
|
vacuumAnalyzeTimer.enable = true;
|
|
upgrade = {
|
|
enable = true;
|
|
stopServices = [
|
|
"hydra-evaluator"
|
|
"hydra-init"
|
|
"hydra-notify"
|
|
"hydra-queue-runner"
|
|
"hydra-send-stats"
|
|
"hydra-server"
|
|
"atticd"
|
|
];
|
|
};
|
|
};
|
|
postgresqlBackup = {
|
|
enable = true;
|
|
compression = "zstd";
|
|
compressionLevel = 19;
|
|
pgdumpOptions = "--create --clean";
|
|
location = backupLocation;
|
|
};
|
|
};
|
|
}
|