summary refs log tree commit diff
path: root/nixos/modules/services/misc/home-assistant.nix
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2018-03-18 19:46:36 +0800
committerRobert Schütz <rschuetz17@gmail.com>2018-03-18 12:46:36 +0100
commit2859483fe952adf3fca90ae6615fec90ef955b4f (patch)
tree5cd505ef08d74ed08933d90a837f3e88e3e5c946 /nixos/modules/services/misc/home-assistant.nix
parent9a49811f66808d533b78dacd5790ff6da08e5f56 (diff)
downloadnixlib-2859483fe952adf3fca90ae6615fec90ef955b4f.tar
nixlib-2859483fe952adf3fca90ae6615fec90ef955b4f.tar.gz
nixlib-2859483fe952adf3fca90ae6615fec90ef955b4f.tar.bz2
nixlib-2859483fe952adf3fca90ae6615fec90ef955b4f.tar.lz
nixlib-2859483fe952adf3fca90ae6615fec90ef955b4f.tar.xz
nixlib-2859483fe952adf3fca90ae6615fec90ef955b4f.tar.zst
nixlib-2859483fe952adf3fca90ae6615fec90ef955b4f.zip
nixos home-assistant: a couple of fixes (#36338)
a) set path to /run/wrappers so ping works
b) run via a target so we can easily inject other components (config copier,
appdaemon)
Diffstat (limited to 'nixos/modules/services/misc/home-assistant.nix')
-rw-r--r--nixos/modules/services/misc/home-assistant.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/nixos/modules/services/misc/home-assistant.nix b/nixos/modules/services/misc/home-assistant.nix
index cc60a143fa6c..ac37c11106ef 100644
--- a/nixos/modules/services/misc/home-assistant.nix
+++ b/nixos/modules/services/misc/home-assistant.nix
@@ -104,7 +104,6 @@ in {
   config = mkIf cfg.enable {
     systemd.services.home-assistant = {
       description = "Home Assistant";
-      wantedBy = [ "multi-user.target" ];
       after = [ "network.target" ];
       preStart = lib.optionalString (cfg.config != null) ''
         rm -f ${cfg.configDir}/configuration.yaml
@@ -121,6 +120,16 @@ in {
         ReadWritePaths = "${cfg.configDir}";
         PrivateTmp = true;
       };
+      path = [
+        "/run/wrappers" # needed for ping
+      ];
+    };
+
+    systemd.targets.home-assistant = rec {
+      description = "Home Assistant";
+      wantedBy = [ "multi-user.target" ];
+      wants = [ "home-assistant.service" ];
+      after = wants;
     };
 
     users.extraUsers.hass = {