1{
2 config,
3 lib,
4 pkgs,
5 ...
6}:
7
8with lib;
9
10let
11 cfg = config.services.owamp;
12in
13{
14
15 ###### interface
16
17 options = {
18 services.owamp.enable = mkEnableOption "OWAMP server";
19 };
20
21 ###### implementation
22
23 config = mkIf cfg.enable {
24 users.users.owamp = {
25 group = "owamp";
26 description = "Owamp daemon";
27 isSystemUser = true;
28 };
29
30 users.groups.owamp = { };
31
32 systemd.services.owamp = {
33 description = "Owamp server";
34 wantedBy = [ "multi-user.target" ];
35
36 serviceConfig = {
37 ExecStart = "${pkgs.owamp}/bin/owampd -R /run/owamp -d /run/owamp -v -Z ";
38 PrivateTmp = true;
39 Restart = "always";
40 Type = "simple";
41 User = "owamp";
42 Group = "owamp";
43 RuntimeDirectory = "owamp";
44 StateDirectory = "owamp";
45 AmbientCapabilities = "cap_net_bind_service";
46 };
47 };
48 };
49}