diff options
| author | Joe Mou <dev@mou.fo> | 2023-12-22 16:38:34 -0800 |
|---|---|---|
| committer | Joe Mou <dev@mou.fo> | 2023-12-22 16:38:34 -0800 |
| commit | 4c705566d91b42ca4c22623346ac377d3932870c (patch) | |
| tree | 4082d2ef1a42a3de564c2185055fa0443cad6b88 | |
| parent | d5f787a40b8406c6f20350b2945a741901cefb44 (diff) | |
Adopt new services.home-assistant.customComponents
| -rw-r--r-- | hostnix/weebnix/home-assistant.nix | 77 |
1 files changed, 44 insertions, 33 deletions
diff --git a/hostnix/weebnix/home-assistant.nix b/hostnix/weebnix/home-assistant.nix index 16c73e7..ad07d2b 100644 --- a/hostnix/weebnix/home-assistant.nix +++ b/hostnix/weebnix/home-assistant.nix @@ -1,38 +1,6 @@ { pkgs, ... }: -let - # Being cleaned up; see https://github.com/NixOS/nixpkgs/pull/160346 - customComponentFromGitHub = { name, ... }@attrs: - { stdenv, fetchFromGitHub }: - stdenv.mkDerivation { - inherit name; - src = fetchFromGitHub (removeAttrs attrs [ "name" ]); - dontUnpack = true; - installPhase = "cp -r $src/custom_components/${name} $out"; - }; - mapComponentTmpfile = map (package: - let drv = pkgs.callPackage package { }; - in "L+ /var/lib/hass/custom_components/${drv.name} - - - - ${drv}/"); -in { - systemd.tmpfiles.rules = - [ "d /var/lib/hass/custom_components 0700 hass hass" ] - ++ mapComponentTmpfile [ - (customComponentFromGitHub { - name = "auth_header"; - owner = "BeryJu"; - repo = "hass-auth-header"; - rev = "v1.10"; - hash = "sha256-dSmY3d8Kx0pXl+20dTGAYgjSH6OhNh53jPX7VLCZs7Y="; - }) - (customComponentFromGitHub { - name = "tuya_local"; - owner = "make-all"; - repo = "tuya-local"; - rev = "2023.9.1"; - hash = "sha256-uHImitvHFU7JoBx+aKzZuvpKl2tJCXwsxxk+sJ1+igk="; - }) - ]; - +{ services.postgresql = { enable = true; ensureDatabases = [ "hass" ]; @@ -56,6 +24,49 @@ in { "met" "radio_browser" ]; + customComponents = [ + ( + pkgs.buildHomeAssistantComponent rec { + owner = "BeryJu"; + domain = "auth_header"; + version = "1.10"; + src = pkgs.fetchFromGitHub { + inherit owner; + repo = "hass-auth-header"; + rev = "refs/tags/v${version}"; + hash = "sha256-dSmY3d8Kx0pXl+20dTGAYgjSH6OhNh53jPX7VLCZs7Y="; + }; + dontBuild = true; + } + ) + ( + pkgs.buildHomeAssistantComponent rec { + owner = "make-all"; + domain = "tuya_local"; + version = "2023.12.1"; + src = pkgs.fetchFromGitHub { + inherit owner; + repo = "tuya-local"; + rev = "refs/tags/${version}"; + hash = "sha256-vi5EmtXAyXaUbJl+yAT5EL0yYb3XFRaAj6fybQRCM4A="; + }; + propagatedBuildInputs = with pkgs.home-assistant.python.pkgs; [ + ( + buildPythonPackage rec { + pname = "tinytuya"; + version = "1.13.1"; + format = "wheel"; + src = pkgs.fetchPypi { + inherit pname version format; + hash = "sha256-j7t4P4U9iuVHyb6HASkf7LmBheHN32IjdKE60HUbjIE="; + }; + } + ) + ]; + dontBuild = true; + } + ) + ]; config = { default_config = { }; http = { |
