2018-06-05 15:15:28 +02:00
|
|
|
{ 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 {
|
2018-06-30 01:58:35 +02:00
|
|
|
users.users = singleton {
|
2018-06-05 15:15:28 +02:00
|
|
|
name = "owamp";
|
|
|
|
group = "owamp";
|
|
|
|
description = "Owamp daemon";
|
|
|
|
};
|
|
|
|
|
2018-06-30 01:58:35 +02:00
|
|
|
users.groups = singleton {
|
2018-06-05 15:15:28 +02:00
|
|
|
name = "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";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|