nixos/{object,toot}: Ensure postgres is accessible on service start

This commit is contained in:
2023-02-19 17:39:15 +00:00
parent eceb1ba892
commit c546331129
3 changed files with 14 additions and 7 deletions

View File

@@ -126,6 +126,15 @@ rec {
};
};
systemdAwaitPostgres = pkg: host: {
after = [ "systemd-networkd-wait-online.service" ];
preStart = ''
until ${pkg}/bin/pg_isready -h ${host}; do
sleep 0.5
done
'';
};
deploy-rs =
with types;
let