summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/home/rhasspy/led-control.nix
blob: b4efe028a4caa4a66fc439e0ea717c3f81e5bb32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{ pkgs, ... }:
let
  cfg = pkgs.writeText "hcl-config.json" (builtins.toJSON {
    engine =  "rhasspy";
    pathToConfig = "/var/lib/rhasspy/de/profile.json";
    hardware =  "respeaker4MicArray";
    pattern = "fake-name";
    enableDoA = false;
  });
in {
  systemd.services.HermesLedControl = {
    description = "Led Server for ReSpeaker 4-array";
    after = [ "network-online.target"  "docker-rhasspy.service" ] ;
    wantedBy = [ "multi-user.target"  ];
    serviceConfig = {
      # User = "nobody"; # need a user with permissions to run nix-shell
      ExecStart = "${pkgs.HermesLedControl}/bin/HermesLedControl --hermesLedControlConfig=${toString cfg}";
      Restart = "always";
      RestartSec = 10;
      PrivateTmp = true;
    };
  };
}