2018-06-05 14:15:28 +01: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 {
|
2019-09-14 18:51:29 +01:00
|
|
|
users.users.owamp = {
|
2018-06-05 14:15:28 +01:00
|
|
|
group = "owamp";
|
|
|
|
description = "Owamp daemon";
|
2019-10-12 21:25:28 +01:00
|
|
|
isSystemUser = true;
|
2018-06-05 14:15:28 +01:00
|
|
|
};
|
|
|
|
|
2019-09-14 18:51:29 +01:00
|
|
|
users.groups.owamp = { };
|
2018-06-05 14:15:28 +01:00
|
|
|
|
|
|
|
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";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|