20 lines
351 B
Nix
20 lines
351 B
Nix
{
|
|
config,
|
|
lib,
|
|
namespace,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.${namespace}.services.home-assistant;
|
|
in
|
|
{
|
|
imports = [ ./options.nix ];
|
|
|
|
config = lib.mkIf (cfg.enable && cfg.dashboards != [ ]) {
|
|
${namespace}.home.file = lib.genAttrs cfg.dashboards (dashboard: {
|
|
text = lib.generators.toYAML { } dashboard;
|
|
force = true;
|
|
});
|
|
};
|
|
}
|