ma bureautomation: add rhasspy

This commit is contained in:
makefu 2023-01-11 15:17:00 +01:00
parent 90acc57fa8
commit ac4728cd2a
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225
2 changed files with 42 additions and 0 deletions

View File

@ -10,6 +10,7 @@ in {
# ./puppy-proxy.nix # ./puppy-proxy.nix
./zigbee2mqtt ./zigbee2mqtt
./rhasspy.nix
# hass config # hass config
## complex configs ## complex configs

View File

@ -0,0 +1,41 @@
{ config, ... }:
let
profiles = "/var/lib/rhasspy";
kiosk_id = toString config.users.users.kiosk.uid;
in
{
virtualisation.oci-containers.containers.rhasspy = {
image = "rhasspy/rhasspy:latest";
environment = {
TZ = "Europe/Berlin";
#PULSE_SERVER = "unix:/run/user/0/pulse/native";
PULSE_SERVER = "tcp:${ config.krebs.build.host.name }:4713";
};
ports = [
"12101:12101"
# "12183:12183"
];
#user = kiosk_id;
volumes = [
"/etc/localtime:/etc/localtime:ro"
"${profiles}:/profiles"
# TODO pulseaudio
#"/run/user/${kiosk_id}/pulse/native:/run/user/0/pulse/native"
#"${config.users.users.kiosk.home}/.config/pulse/cookie:/root/.config/pulse/cookie:ro"
];
cmd = [ "--user-profiles" "/profiles" "--profile" "de" ];
extraOptions = [
"--device=/dev/snd:/dev/snd" "--group-add=audio"
"--net=host"
];
};
systemd.tmpfiles.rules = [
"d ${profiles} 0770 root root - -"
];
systemd.services.docker-rhasspy.after = [ "desktop-manager.service" ];
}