From c91eb45acf2938677efbdcd786f6b46bb6878cc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Schr=C3=B6ter?= Date: Fri, 12 Aug 2022 12:06:52 +0200 Subject: [PATCH] feat: add genie w/ hass integration --- services/genie.nix | 19 +++++++++++++++++++ services/home-assistant.nix | 5 +++++ 2 files changed, 24 insertions(+) create mode 100644 services/genie.nix diff --git a/services/genie.nix b/services/genie.nix new file mode 100644 index 0000000..cbfd064 --- /dev/null +++ b/services/genie.nix @@ -0,0 +1,19 @@ +{ config, lib, pkgs, ... }: + +let + dataDir = "/var/lib/genie-server"; + port = 3232; +in { + virtualisation.oci-containers.containers = { + genie = { + image = "stanfordoval/almond-server"; + ports = [ "${toString port}:3000" ]; + environment.PULSE_SERVER = "unix:/run/pulse/native"; + volumes = [ + "/dev/shm:/dev/shm" + "/run/pulse:/run/pulse" + "${dataDir}:/var/lib/genie-server" + ]; + }; + }; +} diff --git a/services/home-assistant.nix b/services/home-assistant.nix index 1aad617..52baf51 100644 --- a/services/home-assistant.nix +++ b/services/home-assistant.nix @@ -5,6 +5,7 @@ with pkgs; let port = config.services.home-assistant.config.http.server_port; mqttPort = 1883; + geniePort = 3232; in { # just installed for ConBee firmware updates environment.systemPackages = with pkgs; [ deconz ]; @@ -116,6 +117,10 @@ in { delay_time = 0; }; }]; + almond = { + type = "local"; + host = "http://localhost:${toString geniePort}"; + }; }; # configWritable = true; # doesn't work atm };