about summary refs log tree commit diff
path: root/nixos/modules/services/home-automation
diff options
context:
space:
mode:
authorMartin Weinelt <mweinelt@users.noreply.github.com>2023-12-06 04:10:34 +0100
committerGitHub <noreply@github.com>2023-12-06 04:10:34 +0100
commitb908dc8654f4f4da9cad594bae49e3a03107c945 (patch)
treef8a44357763052fa8e79a683cad4ac9f281571b9 /nixos/modules/services/home-automation
parentba75066821491104c5104fd3b9503fb76d18ecf5 (diff)
parent663dbfb82d631c8fcc4b6c46a4db3760a99e1c36 (diff)
downloadnixlib-b908dc8654f4f4da9cad594bae49e3a03107c945.tar
nixlib-b908dc8654f4f4da9cad594bae49e3a03107c945.tar.gz
nixlib-b908dc8654f4f4da9cad594bae49e3a03107c945.tar.bz2
nixlib-b908dc8654f4f4da9cad594bae49e3a03107c945.tar.lz
nixlib-b908dc8654f4f4da9cad594bae49e3a03107c945.tar.xz
nixlib-b908dc8654f4f4da9cad594bae49e3a03107c945.tar.zst
nixlib-b908dc8654f4f4da9cad594bae49e3a03107c945.zip
Merge pull request #271785 from SuperSandro2000/hass-custom-lovelace
nixos/home-assistant: fix custom lovelace module loading
Diffstat (limited to 'nixos/modules/services/home-automation')
-rw-r--r--nixos/modules/services/home-automation/home-assistant.nix6
1 files changed, 2 insertions, 4 deletions
diff --git a/nixos/modules/services/home-automation/home-assistant.nix b/nixos/modules/services/home-automation/home-assistant.nix
index 6aa0ae9eba47..f389b2d84dab 100644
--- a/nixos/modules/services/home-automation/home-assistant.nix
+++ b/nixos/modules/services/home-automation/home-assistant.nix
@@ -11,14 +11,12 @@ let
   # options shown in settings.
   # We post-process the result to add support for YAML functions, like secrets or includes, see e.g.
   # https://www.home-assistant.io/docs/configuration/secrets/
-  filteredConfig = lib.converge (lib.filterAttrsRecursive (_: v: ! elem v [ null ])) cfg.config or {};
+  filteredConfig = lib.converge (lib.filterAttrsRecursive (_: v: ! elem v [ null ])) (lib.recursiveUpdate customLovelaceModulesResources (cfg.config or {}));
   configFile = pkgs.runCommandLocal "configuration.yaml" { } ''
     cp ${format.generate "configuration.yaml" filteredConfig} $out
     sed -i -e "s/'\!\([a-z_]\+\) \(.*\)'/\!\1 \2/;s/^\!\!/\!/;" $out
   '';
-  lovelaceConfig = if (cfg.lovelaceConfig == null) then {}
-    else (lib.recursiveUpdate customLovelaceModulesResources cfg.lovelaceConfig);
-  lovelaceConfigFile = format.generate "ui-lovelace.yaml" lovelaceConfig;
+  lovelaceConfigFile = format.generate "ui-lovelace.yaml" cfg.lovelaceConfig;
 
   # Components advertised by the home-assistant package
   availableComponents = cfg.package.availableComponents;