infrastructure/nixos-modules/postgresql/default.nix

27 lines
533 B
Nix
Raw Permalink Normal View History

2024-10-02 15:52:04 +02:00
{
config,
pkgs,
lib,
...
}:
let
cfg = config.qois.postgresql;
in
with lib;
{
options.qois.postgresql = {
# Note: this module is auto-enabled if postgres is used.
package = mkPackageOption pkgs "postgresql" {
example = "postgresql_15";
default = null;
};
2024-10-02 15:52:04 +02:00
};
config = mkIf config.services.postgresql.enable {
services.postgresql.package = cfg.package;
2024-10-02 15:52:04 +02:00
services.postgresqlBackup.enable = true;
qois.backup-client.includePaths = [ config.services.postgresqlBackup.location ];
};
}