From e4a6e320bb8f2adb79a3c9b83478da753de4eedb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 24 Apr 2018 00:12:19 +0200 Subject: [PATCH] home-assistant: simplify definition of configFile --- nixos/modules/services/misc/home-assistant.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/misc/home-assistant.nix b/nixos/modules/services/misc/home-assistant.nix index b9a97296779..1dc7b44ee37 100644 --- a/nixos/modules/services/misc/home-assistant.nix +++ b/nixos/modules/services/misc/home-assistant.nix @@ -5,9 +5,10 @@ with lib; let cfg = config.services.home-assistant; - configFile = pkgs.writeText "configuration.json" (builtins.toJSON (if cfg.applyDefaultConfig - then (lib.recursiveUpdate defaultConfig (if (isNull cfg.config) then {} else cfg.config)) - else cfg.config)); + # cfg.config != null can be assumed here + configFile = pkgs.writeText "configuration.json" + (builtins.toJSON (if cfg.applyDefaultConfig then + (lib.recursiveUpdate defaultConfig cfg.config) else cfg.config)); availableComponents = pkgs.home-assistant.availableComponents;