Skip to content
Permalink
Browse files

nixos home-assistant: a couple of fixes

a) set path to /run/wrappers so ping works
b) restart if the configuration file changes
c) run via a target so we can easily inject other components (config copier,
appdaemon)
  • Loading branch information
peterhoeg committed Mar 5, 2018
1 parent a66ce38 commit b8eac03478bb40b5f168e0596623b3e20abea6ae
Showing with 13 additions and 1 deletion.
  1. +13 −1 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,19 @@ in {
ReadWritePaths = "${cfg.configDir}";
PrivateTmp = true;
};
restartTriggers = [
configFile
];
path = [
"/run/wrappers"
];
};

systemd.targets.home-assistant = rec {
description = "Home Assistant";
wantedBy = [ "multi-user.target" ];
wants = [ "home-assistant.service" ];
after = wants;
};

users.extraUsers.hass = {

0 comments on commit b8eac03

Please sign in to comment.
You can’t perform that action at this time.