idk
This commit is contained in:
25
modules/nixos/homeassistant/dashboards/default.nix
Normal file
25
modules/nixos/homeassistant/dashboards/default.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
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:
|
||||
let
|
||||
dashboardFile = "homeassistant/lovelace/${dashboard.title}.yaml";
|
||||
in
|
||||
{
|
||||
text = lib.generators.toYAML { } dashboard;
|
||||
force = true;
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user