chore(postgresql): shared data

This commit is contained in:
arcnmx 2024-04-08 11:32:34 -07:00
parent d6b8883c24
commit 38996b3e0c

View file

@ -4,6 +4,7 @@
...
}: let
inherit (lib.modules) mkIf mkDefault mkAfter;
inherit (lib) versions;
cfg = config.services.postgresql;
in {
services.postgresql = {
@ -33,10 +34,13 @@ in {
];
};
systemd.services.postgresql = mkIf cfg.enable {
postStart = mkAfter ''
$PSQL -tAf ${config.sops.secrets.postgresql-init.path}
'';
systemd = {
services.postgresql = mkIf cfg.enable {
gensokyo-zone.sharedMounts."postgresql/${versions.major cfg.package.version}".path = cfg.dataDir;
postStart = mkAfter ''
$PSQL -tAf ${config.sops.secrets.postgresql-init.path}
'';
};
};
sops.secrets.postgresql-init = {