aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/nixos/modules/services/networking/owamp.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/modules/services/networking/owamp.nix')
-rw-r--r--nixpkgs/nixos/modules/services/networking/owamp.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/nixpkgs/nixos/modules/services/networking/owamp.nix b/nixpkgs/nixos/modules/services/networking/owamp.nix
new file mode 100644
index 00000000000..821a0258f4b
--- /dev/null
+++ b/nixpkgs/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.users = singleton {
+ name = "owamp";
+ group = "owamp";
+ description = "Owamp daemon";
+ };
+
+ users.groups = 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";
+ };
+ };
+ };
+}