waffentrager: add postgresql
This commit is contained in:
parent
c47555fec7
commit
d204976cce
|
@ -3,6 +3,8 @@
|
||||||
imports =
|
imports =
|
||||||
[
|
[
|
||||||
./elements.nix
|
./elements.nix
|
||||||
|
./postgresql.nix
|
||||||
];
|
];
|
||||||
waffentragerService.elements.enable = true;
|
waffentragerService.elements.enable = true;
|
||||||
|
waffentragerService.postgresql.enable = true;
|
||||||
}
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
{ 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;
|
||||||
|
services.postgresql.dataDir = "${config.waffentragerService.elements.path}/services/postgresql";
|
||||||
|
systemd.services.postgresql = {
|
||||||
|
partOf = ["elements-mount.service"];
|
||||||
|
requires = ["elements-mount.service"];
|
||||||
|
after = ["elements-mount.service"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue