diff --git a/flake.nix b/flake.nix index cad6efe..1b21d90 100644 --- a/flake.nix +++ b/flake.nix @@ -144,6 +144,7 @@ ./modules/uptime_kuma.nix ./modules/rss.nix ./modules/wiki.nix + ./modules/home-assistant.nix # Host-specific config nixos-hardware.nixosModules.raspberry-pi-4 diff --git a/modules/home-assistant.nix b/modules/home-assistant.nix new file mode 100644 index 0000000..8178b88 --- /dev/null +++ b/modules/home-assistant.nix @@ -0,0 +1,53 @@ +{ config, lib, pkgs, ... }: +{ + services.home-assistant = { + enable = true; + openFirewall = true; + configWritable = true; # remove after setup + configDir = "/var/lib/hass"; + config = { + lovelace.mode = "yaml"; + server_port = 8123; + server_host = [ + "0.0.0.0" + "::" + ]; + homeassistant = { + name = "Norumbega"; + unit_system = "metric"; + temperature_unit = "C"; + longitude = 18.52; + lattitude = 73.85; + }; + }; + extraComponents = [ + "analytics" + "default_config" + "esphome" + "met" + ]; + customComponents = with pkgs.home-assistant-custom-components; [ + prometheus_sensor + ]; + locelaceConfigWritable = true; # remove once setup + lovelaceConfig = { + title = "My Awesome Home"; + views = [ + { + title = "Example"; + cards = [ + { + type = "markdown"; + title = "Lovelace"; + content = "Welcome to your **Lovelace UI**."; + } + ]; + } + ]; + }; + customLovelaceModules = with pkgs.home-assistant-custom-lovelace-modules; [ + mini-graph-card + mini-media-player + ]; + }; +}