nix-config/modules/nixos/services/postgresql.nix
Jordan Holt 328a50c365
All checks were successful
Check flake / build-amd64-linux (push) Successful in 3m14s
Refactor modules into nixos and home-manager
2025-01-19 01:22:43 +00:00

41 lines
685 B
Nix

{
config,
lib,
...
}:
let
cfg = config.modules.services.postgresql;
in {
options.modules.services.postgresql = {
enable = lib.mkOption {
default = false;
example = true;
};
};
config = lib.mkIf cfg.enable {
services.postgresql = {
enable = true;
initdbArgs = [
"--allow-group-access"
"--encoding=UTF8"
"--locale=C"
];
settings = {
log_connections = true;
log_disconnections = true;
log_destination = lib.mkForce "syslog";
};
};
services.borgmatic.settings = {
postgresql_databases = [
{
name = "all";
}
];
};
};
}