mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-23 06:03:40 +00:00
358296c05a
You can retrieve the one way latency between your client and the remote host via owping.
48 lines
923 B
Nix
48 lines
923 B
Nix
{ 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.extraUsers = singleton {
|
|
name = "owamp";
|
|
group = "owamp";
|
|
description = "Owamp daemon";
|
|
};
|
|
|
|
users.extraGroups = singleton {
|
|
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";
|
|
};
|
|
};
|
|
};
|
|
}
|