hswaw/machines/customs: check in code.hackerspace.pl/vuko/customs

Change-Id: Ic698cce2ef0060a54b195cf90574696b8be1eb0f
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1162
Reviewed-by: informatic <informatic@hackerspace.pl>
diff --git a/hswaw/machines/customs.hackerspace.pl/ulogd2/default.nix b/hswaw/machines/customs.hackerspace.pl/ulogd2/default.nix
new file mode 100644
index 0000000..01157fd
--- /dev/null
+++ b/hswaw/machines/customs.hackerspace.pl/ulogd2/default.nix
@@ -0,0 +1,27 @@
+{ pkgs ? import <nixpkgs> {} }:
+
+pkgs.stdenv.mkDerivation {
+  name = "ulogd2";
+
+  buildInputs = with pkgs; [
+    gnumake libnetfilter_acct libnetfilter_conntrack libnetfilter_log libmnl
+    libnfnetlink automake autoconf autogen libtool pkg-config libpcap
+  ];
+
+  # hack to capture TCP and UDP port numbers (first 8 bytes) but omit rest of payload
+  patches = [ ./onlyports.patch ];
+
+  preConfigure = ''
+    echo running autogen
+    ./autogen.sh
+    autoheader
+    automake --force-missing --add-missing
+    ./configure --help
+  '';
+
+  src = pkgs.fetchgit {
+    url = "https://git.netfilter.org/ulogd2/";
+    rev = "63135e73fd878cb71b1eebf8e877c4d4c34feba7";
+    sha256 = "1ccfb8l7q9k4fy9s0sgab49ma9xphr4x4ap0v52xfrnwx57h87s2";
+  };
+}