about summary refs log tree commit diff
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2018-11-05 16:29:24 +0100
committeraszlig <aszlig@nix.build>2018-11-05 16:39:42 +0100
commitb162b400073c5f526686c67306dbd324503160ea (patch)
treea4dd2e67528b84c585e3201881cd851c6fe36b51
parentcd05d5a112c83b80d8b9432842c97c27a9d03a90 (diff)
downloadnixlib-b162b400073c5f526686c67306dbd324503160ea.tar
nixlib-b162b400073c5f526686c67306dbd324503160ea.tar.gz
nixlib-b162b400073c5f526686c67306dbd324503160ea.tar.bz2
nixlib-b162b400073c5f526686c67306dbd324503160ea.tar.lz
nixlib-b162b400073c5f526686c67306dbd324503160ea.tar.xz
nixlib-b162b400073c5f526686c67306dbd324503160ea.tar.zst
nixlib-b162b400073c5f526686c67306dbd324503160ea.zip
ip2unix: init at 1.0.0
This tool was initially built specifically for nixcloud to prevent a few
annoying programs from binding to IP sockets.

While initially only accepting a JSON file as input, the tool now has a
proper command line interface and it's also generally usable to turn IP
sockets of any program into Unix sockets.

Another thing that might be even useful for NixOS modules is the
possibility to bend programs into using systemd socket activation.

Signed-off-by: aszlig <aszlig@nix.build>
-rw-r--r--pkgs/tools/networking/ip2unix/default.nix32
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/tools/networking/ip2unix/default.nix b/pkgs/tools/networking/ip2unix/default.nix
new file mode 100644
index 000000000000..14f8599f7e97
--- /dev/null
+++ b/pkgs/tools/networking/ip2unix/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig, libyamlcpp, systemd
+, asciidoctor, python3Packages
+}:
+
+stdenv.mkDerivation rec {
+  name = "ip2unix-${version}";
+  version = "1.0.0";
+
+  src = fetchFromGitHub {
+    owner = "nixcloud";
+    repo = "ip2unix";
+    rev = "v${version}";
+    sha256 = "1s6gyrrzgifr6gagcw4vx9xznxvdl14y14r0d1xc72j69b00zc4q";
+  };
+
+  nativeBuildInputs = [
+    meson ninja pkgconfig asciidoctor
+    python3Packages.pytest python3Packages.pytest-timeout
+  ];
+
+  buildInputs = [ libyamlcpp systemd ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = https://github.com/nixcloud/ip2unix;
+    description = "Turn IP sockets into Unix domain sockets";
+    platforms = stdenv.lib.platforms.linux;
+    license = stdenv.lib.licenses.lgpl3;
+    maintainers = [ stdenv.lib.maintainers.aszlig ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 3cd0cc4887a8..e8aa4618fad2 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -3417,6 +3417,8 @@ with pkgs;
 
   ip2location = callPackage ../tools/networking/ip2location { };
 
+  ip2unix = callPackage ../tools/networking/ip2unix { };
+
   ipad_charge = callPackage ../tools/misc/ipad_charge { };
 
   iperf2 = callPackage ../tools/networking/iperf/2.nix { };