mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-09 12:05:50 +03:00
nixos/home-assistant: Wait for {mysql,postgresql}.service
Database provisioning was shown to be racy since adding a recorder test using PostgreSQL. There is no harm in waiting for these services, because if they're not available they will be ignored.
This commit is contained in:
parent
13faa004b6
commit
918100f48f
1 changed files with 7 additions and 1 deletions
|
@ -364,7 +364,13 @@ in {
|
|||
|
||||
systemd.services.home-assistant = {
|
||||
description = "Home Assistant";
|
||||
after = [ "network-online.target" ];
|
||||
after = [
|
||||
"network-online.target"
|
||||
|
||||
# prevent races with database creation
|
||||
"mysql.service"
|
||||
"postgresql.service"
|
||||
];
|
||||
preStart = optionalString (cfg.config != null) (if cfg.configWritable then ''
|
||||
cp --no-preserve=mode ${configFile} "${cfg.configDir}/configuration.yaml"
|
||||
'' else ''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue