feat: add genie w/ hass integration

This commit is contained in:
Felix Schröter 2022-08-12 12:06:52 +02:00
parent 170612a57e
commit c91eb45acf
Signed by: felschr
GPG key ID: 671E39E6744C807D
2 changed files with 24 additions and 0 deletions

19
services/genie.nix Normal file
View file

@ -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"
];
};
};
}

View file

@ -5,6 +5,7 @@ with pkgs;
let let
port = config.services.home-assistant.config.http.server_port; port = config.services.home-assistant.config.http.server_port;
mqttPort = 1883; mqttPort = 1883;
geniePort = 3232;
in { in {
# just installed for ConBee firmware updates # just installed for ConBee firmware updates
environment.systemPackages = with pkgs; [ deconz ]; environment.systemPackages = with pkgs; [ deconz ];
@ -116,6 +117,10 @@ in {
delay_time = 0; delay_time = 0;
}; };
}]; }];
almond = {
type = "local";
host = "http://localhost:${toString geniePort}";
};
}; };
# configWritable = true; # doesn't work atm # configWritable = true; # doesn't work atm
}; };