summary refs log tree commit diff
path: root/nixos/modules/services/home-automation
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2022-02-01 21:25:12 +0100
committerMartin Weinelt <hexa@darmstadt.ccc.de>2022-02-15 23:41:50 +0100
commit918100f48f76152fbfcf20689af33288067d1122 (patch)
tree82aa3b1945343f791fecd859844bb39401ef6284 /nixos/modules/services/home-automation
parent13faa004b65c15a5a687db38943eb34347e20479 (diff)
downloadnixpkgs-918100f48f76152fbfcf20689af33288067d1122.tar
nixpkgs-918100f48f76152fbfcf20689af33288067d1122.tar.gz
nixpkgs-918100f48f76152fbfcf20689af33288067d1122.tar.bz2
nixpkgs-918100f48f76152fbfcf20689af33288067d1122.tar.lz
nixpkgs-918100f48f76152fbfcf20689af33288067d1122.tar.xz
nixpkgs-918100f48f76152fbfcf20689af33288067d1122.tar.zst
nixpkgs-918100f48f76152fbfcf20689af33288067d1122.zip
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.
Diffstat (limited to 'nixos/modules/services/home-automation')
-rw-r--r--nixos/modules/services/home-automation/home-assistant.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/nixos/modules/services/home-automation/home-assistant.nix b/nixos/modules/services/home-automation/home-assistant.nix
index eb70cf4c9e2..15aea7de902 100644
--- a/nixos/modules/services/home-automation/home-assistant.nix
+++ b/nixos/modules/services/home-automation/home-assistant.nix
@@ -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 ''