blob: d73fc164488c0fb657e0b1e99af9534dfa0ec2b3 (
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
42
43
44
45
46
47
48
49
50
|
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.helix-player;
helixPackage = pkgs.eth.helix;
runtimeDirectory = "helix-player";
socket = "/run/${runtimeDirectory}/listen.sock";
in {
options.services.helix-player = {
enable = mkEnableOption "Whether to enable helix-player";
socket = mkOption {
type = types.str;
readOnly = true;
description = "Path of the UNIX socket to listen on.";
example = socket;
};
};
config = mkIf cfg.enable {
services.helix-player.socket = socket;
environment.systemPackages = [
helixPackage
];
systemd.services.helix-player = {
enable = true;
description = "Helix UPnP player & controller";
wants = [ "network.target" ];
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
DynamicUser = "yes";
Group = config.services.nginx.group;
RuntimeDirectory = "${runtimeDirectory}";
ExecStart = "${helixPackage}/bin/helix-player -socket ${socket}";
};
};
};
}
|