summary refs log tree commit diff
path: root/nixos/modules/services/networking/owamp.nix
diff options
context:
space:
mode:
authorMatthieu Coudron <mattator@gmail.com>2018-06-05 22:15:28 +0900
committerMatthieu Coudron <mattator@gmail.com>2018-06-05 22:15:28 +0900
commit358296c05a790777e11938f3eb97febcb8da0685 (patch)
tree1e11fc8fd081958655f7c356de81a6e9abf502e2 /nixos/modules/services/networking/owamp.nix
parent8981cb7b6849ac3d69293d54f7af0538365a75a4 (diff)
downloadnixpkgs-358296c05a790777e11938f3eb97febcb8da0685.tar
nixpkgs-358296c05a790777e11938f3eb97febcb8da0685.tar.gz
nixpkgs-358296c05a790777e11938f3eb97febcb8da0685.tar.bz2
nixpkgs-358296c05a790777e11938f3eb97febcb8da0685.tar.lz
nixpkgs-358296c05a790777e11938f3eb97febcb8da0685.tar.xz
nixpkgs-358296c05a790777e11938f3eb97febcb8da0685.tar.zst
nixpkgs-358296c05a790777e11938f3eb97febcb8da0685.zip
owamp: adding module
You can retrieve the one way latency between your client and the remote
host via owping.
Diffstat (limited to 'nixos/modules/services/networking/owamp.nix')
-rw-r--r--nixos/modules/services/networking/owamp.nix47
1 files changed, 47 insertions, 0 deletions
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";
+      };
+    };
+  };
+}