summaryrefslogtreecommitdiff
path: root/hostnix/weebnix
diff options
context:
space:
mode:
Diffstat (limited to 'hostnix/weebnix')
-rw-r--r--hostnix/weebnix/home-assistant.nix77
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 = {