feat(hass): setup ui declaratively
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-10-06 05:45:08 -04:00
parent a6dd198820
commit 52d0196dc1
4 changed files with 68 additions and 7 deletions

View file

@ -1,12 +1,68 @@
{dracul-ha-src, ...}: { {
caule-themes-src,
dracul-ha-src,
lib,
pkgs,
...
}: let
inherit (lib) concatStringsSep getExe;
inherit (pkgs.writers) writeYAML;
themes = [
"${caule-themes-src}/themes/caule-themes-pack-1.yaml"
"${dracul-ha-src}/themes/dracul-ha.yaml"
];
in {
systemd.services.home-assistant.preStart = let
WorkingDirectory = "/var/lib/hass";
in
getExe (pkgs.writeShellApplication {
name = "ha-themes";
text = ''
mkdir -p ${WorkingDirectory}/themes
cp -f ${concatStringsSep " " themes} ${WorkingDirectory}/themes
'';
});
services.home-assistant = { services.home-assistant = {
config = { config.frontend = {
# GUI themes = "!include_dir_merge_named themes";
frontend = { };
themes = "!include ${dracul-ha-src}/themes/dracul-ha.yaml";
}; lovelaceConfig = {
lovelace = { title = "Our House";
views = [
{
path = "home";
title = "Home";
cards = [
{
type = "entities";
entities = [
"switch.smartplug1"
"switch.smartplug3"
];
}
];
}
];
};
config.lovelace.dashboards = {
esphome-dash = {
title = "ESPHome";
icon = "mdi:car-esp";
mode = "yaml"; mode = "yaml";
show_in_sidebar = true;
require_admin = true;
filename = writeYAML "esphome.yaml" {
strategy = {
type = "iframe";
url = "https://esphome.nelim.org";
};
};
}; };
}; };
}; };

Binary file not shown.

BIN
flake.nix

Binary file not shown.

View file

@ -226,6 +226,11 @@ let
owner = "berti24"; owner = "berti24";
repo = "dracul-ha"; repo = "dracul-ha";
} }
{
name = "caule-themes-src";
owner = "ricardoquecria";
repo = "caule-themes-pack-1";
}
# Nvim plugins # Nvim plugins
{ {