summaryrefslogtreecommitdiff
path: root/os/kay/modules/home-assistant.nix
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-09-13 12:12:36 +0530
committersinanmohd <sinan@sinanmohd.com>2024-09-13 12:19:13 +0530
commit8b148d39345ec9d06298c93fb836b6ff783a4738 (patch)
tree91da09e692fc9217a9457b7fb2b1f009fa5108eb /os/kay/modules/home-assistant.nix
parent1e6c9f709f0bc233f294c938c9ff57f166553557 (diff)
kay/home-assistant: init
Diffstat (limited to 'os/kay/modules/home-assistant.nix')
-rw-r--r--os/kay/modules/home-assistant.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/os/kay/modules/home-assistant.nix b/os/kay/modules/home-assistant.nix
new file mode 100644
index 0000000..b611817
--- /dev/null
+++ b/os/kay/modules/home-assistant.nix
@@ -0,0 +1,39 @@
+{ pkgs, ... }: {
+ services.postgresql = {
+ enable = true;
+
+ ensureDatabases = [ "hass" ];
+ ensureUsers = [{
+ name = "hass";
+ ensureDBOwnership = true;
+ }];
+ };
+
+ services.home-assistant = {
+ enable = true;
+ package = (pkgs.home-assistant.override {
+ extraPackages = py: with py; [ psycopg2 ];
+ }).overrideAttrs (oldAttrs: {
+ doInstallCheck = false;
+ });
+
+ extraComponents = [
+ "analytics"
+ "google_translate"
+ "met"
+ "radio_browser"
+ "shopping_list"
+ ];
+
+ config = {
+ default_config = {};
+
+ recorder.db_url = "postgresql://@/hass";
+ http = {
+ server_host = "127.0.0.1";
+ trusted_proxies = [ "127.0.0.1" ];
+ use_x_forwarded_for = true;
+ };
+ };
+ };
+}