From 358296c05a790777e11938f3eb97febcb8da0685 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Tue, 5 Jun 2018 22:15:28 +0900 Subject: owamp: adding module You can retrieve the one way latency between your client and the remote host via owping. --- nixos/modules/services/networking/owamp.nix | 47 +++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 nixos/modules/services/networking/owamp.nix (limited to 'nixos/modules/services/networking/owamp.nix') diff --git a/nixos/modules/services/networking/owamp.nix b/nixos/modules/services/networking/owamp.nix new file mode 100644 index 00000000000..a0d3e70d8e5 --- /dev/null +++ b/nixos/modules/services/networking/owamp.nix @@ -0,0 +1,47 @@ +{ 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"; + }; + }; + }; +} -- cgit 1.4.1