From ac4728cd2a3fea04b1822dde50413ebb1fd4f124 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 11 Jan 2023 15:17:00 +0100 Subject: ma bureautomation: add rhasspy --- makefu/2configs/bureautomation/default.nix | 1 + makefu/2configs/bureautomation/rhasspy.nix | 41 ++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 makefu/2configs/bureautomation/rhasspy.nix diff --git a/makefu/2configs/bureautomation/default.nix b/makefu/2configs/bureautomation/default.nix index a3af30d2f..cd162ba3b 100644 --- a/makefu/2configs/bureautomation/default.nix +++ b/makefu/2configs/bureautomation/default.nix @@ -10,6 +10,7 @@ in { # ./puppy-proxy.nix ./zigbee2mqtt + ./rhasspy.nix # hass config ## complex configs diff --git a/makefu/2configs/bureautomation/rhasspy.nix b/makefu/2configs/bureautomation/rhasspy.nix new file mode 100644 index 000000000..8fbfd9312 --- /dev/null +++ b/makefu/2configs/bureautomation/rhasspy.nix @@ -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" ]; +} -- cgit v1.2.3