summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/bureautomation/rhasspy.nix
blob: 8fbfd93125bb5245605360a7e98fa633c58b37a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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" ];
}