2024-03-23 11:45:10 +01:00
|
|
|
{ materusArg, config, lib, pkgs, ... }:
|
|
|
|
{
|
|
|
|
options.waffentragerService.postgresql.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable postgresql";
|
|
|
|
|
|
|
|
|
|
|
|
config =
|
|
|
|
let
|
|
|
|
cfg = config.waffentragerService.postgresql;
|
|
|
|
in
|
|
|
|
lib.mkIf cfg.enable {
|
|
|
|
waffentragerService.elements.enable = true;
|
|
|
|
|
|
|
|
services.postgresql.enable = true;
|
|
|
|
services.postgresql.package = pkgs.postgresql_16;
|
2024-03-23 12:33:10 +01:00
|
|
|
services.postgresql.dataDir = "${config.waffentragerService.elements.postgresqlDir}/16";
|
2024-03-23 11:45:10 +01:00
|
|
|
systemd.services.postgresql = {
|
2024-03-23 12:33:10 +01:00
|
|
|
partOf = [ "elements-mount.service" ];
|
|
|
|
requires = [ "elements-mount.service" ];
|
|
|
|
after = [ "elements-mount.service" ];
|
2024-03-23 11:45:10 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|