mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-12-03 05:26:18 +01:00
42 lines
881 B
Nix
42 lines
881 B
Nix
|
{ 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";
|
||
|
|
||
|
ensureDatabases = [ "hydra" ];
|
||
|
ensureExtensions = {
|
||
|
"pg_trgm" = [ "hydra" ];
|
||
|
};
|
||
|
ensureUsers = singleton {
|
||
|
name = "hydra";
|
||
|
ensurePermissions = {
|
||
|
"DATABASE \"hydra\"" = "ALL PRIVILEGES";
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
}
|