summaryrefslogblamecommitdiff
path: root/os/kay/modules/home-assistant.nix
blob: 62d5d28d9aee2e238be014b7497a336b71b44c79 (plain) (tree)
























                                                

              













                                              
{ 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"
      "tplink"
      "tuya"
    ];

    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;
      };
    };
  };
}