mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
chore(postgresql): shared data
This commit is contained in:
parent
d6b8883c24
commit
38996b3e0c
1 changed files with 8 additions and 4 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue