nixos/colony-psql: Add Netdata

This commit is contained in:
Jack O'Sullivan 2022-06-13 02:14:18 +01:00
parent b886f06ea2
commit 45b9c8b74b
2 changed files with 28 additions and 10 deletions

View File

@ -33,7 +33,7 @@
};
firewall = {
tcp.allowed = [ 5432 ];
tcp.allowed = [ 19999 5432 ];
};
};
@ -42,23 +42,37 @@
};
services = {
netdata = {
enable = true;
python = {
enable = true;
extraPackages = ps: with ps; [ psycopg2 ];
};
configDir = {
"python.d/postgres.conf" = pkgs.writeText "netdata-postgres.conf" ''
local:
user: postgres
'';
};
};
postgresql = {
package = pkgs.postgresql_14;
enable = true;
enableTCPIP = true;
authentication = with lib.my.colony.prefixes; ''
local all postgres peer map=local
host all all ${all.v4} md5
host all all ${all.v6} md5
'';
ensureUsers = [
{
name = "root";
ensurePermissions = {
"ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES";
};
}
];
identMap = ''
local postgres postgres
local root postgres
local netdata postgres
local dev postgres
'';
};
};
}

View File

@ -86,7 +86,11 @@ in
"netdata-colony.${lib.my.pubDomain}" =
let
hosts = [ "vm" "fw" "ctr" "http" "jackflix-ctr" "chatterbox-ctr" ];
hosts = [
"vm"
"fw" "ctr"
"http" "jackflix-ctr" "chatterbox-ctr" "colony-psql-ctr"
];
matchHosts = concatStringsSep "|" hosts;
in
mkMerge [