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 = { firewall = {
tcp.allowed = [ 5432 ]; tcp.allowed = [ 19999 5432 ];
}; };
}; };
@ -42,23 +42,37 @@
}; };
services = { 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 = { postgresql = {
package = pkgs.postgresql_14; package = pkgs.postgresql_14;
enable = true; enable = true;
enableTCPIP = true; enableTCPIP = true;
authentication = with lib.my.colony.prefixes; '' authentication = with lib.my.colony.prefixes; ''
local all postgres peer map=local
host all all ${all.v4} md5 host all all ${all.v4} md5
host all all ${all.v6} md5 host all all ${all.v6} md5
''; '';
ensureUsers = [ identMap = ''
{ local postgres postgres
name = "root"; local root postgres
ensurePermissions = { local netdata postgres
"ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES"; local dev postgres
}; '';
}
];
}; };
}; };
} }

View File

@ -86,7 +86,11 @@ in
"netdata-colony.${lib.my.pubDomain}" = "netdata-colony.${lib.my.pubDomain}" =
let 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; matchHosts = concatStringsSep "|" hosts;
in in
mkMerge [ mkMerge [