summary refs log tree commit diff
path: root/nixos/modules/services/networking/owamp.nix
blob: baf64347b099d6ec8f5fdc956b50ed3731d964bb (plain) (blame)
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
{ config, lib, pkgs, ... }:

with lib;

let
  cfg = config.services.owamp;
in
{

  ###### interface

  options = {
    services.owamp.enable = mkEnableOption "Enable OWAMP server";
  };


  ###### implementation

  config = mkIf cfg.enable {
    users.users.owamp = {
      group = "owamp";
      description = "Owamp daemon";
      isSystemUser = true;
    };

    users.groups.owamp = { };

    systemd.services.owamp = {
      description = "Owamp server";
      wantedBy = [ "multi-user.target" ];

      serviceConfig = {
        ExecStart="${pkgs.owamp}/bin/owampd -R /run/owamp -d /run/owamp -v -Z ";
        PrivateTmp = true;
        Restart = "always";
        Type="simple";
        User = "owamp";
        Group = "owamp";
        RuntimeDirectory = "owamp";
        StateDirectory = "owamp";
        AmbientCapabilities = "cap_net_bind_service";
      };
    };
  };
}