2023-06-13 23:07:31 +02:00
|
|
|
{ makeSystem
|
|
|
|
, nixpkgs
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
inherit (nixpkgs.lib)
|
|
|
|
singleton;
|
|
|
|
in
|
|
|
|
makeSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
name = "nixng-hydra-postgresql";
|
|
|
|
inherit nixpkgs;
|
|
|
|
config = { pkgs, config, ... }:
|
|
|
|
{
|
|
|
|
config = {
|
|
|
|
dumb-init = {
|
|
|
|
enable = true;
|
|
|
|
type.services = {};
|
|
|
|
};
|
|
|
|
services.postgresql = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.postgresql_12;
|
|
|
|
|
|
|
|
initialScript = "/secrets/init.sql";
|
|
|
|
enableTCPIP = true;
|
|
|
|
|
|
|
|
authentication = "host all all all md5";
|
|
|
|
|
2023-10-23 13:49:59 +02:00
|
|
|
config = {
|
2023-10-23 16:10:01 +02:00
|
|
|
max_connections = 1024;
|
2023-10-23 13:49:59 +02:00
|
|
|
};
|
|
|
|
|
2023-06-13 23:07:31 +02:00
|
|
|
ensureDatabases = [ "hydra" ];
|
|
|
|
ensureExtensions = {
|
|
|
|
"pg_trgm" = [ "hydra" ];
|
|
|
|
};
|
|
|
|
ensureUsers = singleton {
|
|
|
|
name = "hydra";
|
|
|
|
ensurePermissions = {
|
|
|
|
"DATABASE \"hydra\"" = "ALL PRIVILEGES";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|