kusakabe: add postgresql for twitterchiver

This commit is contained in:
Luke Granger-Brown 2020-10-03 23:13:20 +00:00
parent 2b4f4d6b16
commit 4b878360f5

View file

@ -94,6 +94,9 @@ in {
# k8s # k8s
80 443 6443 22623 80 443 6443 22623
# PostgreSQL
5432
]; ];
allowedTCPPorts = [ 80 443 ]; allowedTCPPorts = [ 80 443 ];
}; };
@ -259,5 +262,23 @@ in {
}; };
users.users.lukegb.extraGroups = lib.mkAfter [ "libvirtd" ]; users.users.lukegb.extraGroups = lib.mkAfter [ "libvirtd" ];
services.postgresql = {
enable = true;
authentication = ''
host all all 137.74.77.21/32 md5
host all all 137.74.77.22/32 md5
host all all 137.74.77.23/32 md5
'';
ensureDatabases = [
"twitterchiver"
];
ensureUsers = [{
name = "twitterchiver";
ensurePermissions = { "DATABASE twitterchiver" = "ALL PRIVILEGES"; };
}];
enableTCPIP = true;
};
services.postgresqlBackup.enable = true;
system.stateVersion = "20.03"; system.stateVersion = "20.03";
} }