summary refs log tree commit diff
path: root/pkgs/tools/networking/nxdomain/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/networking/nxdomain/default.nix')
-rw-r--r--pkgs/tools/networking/nxdomain/default.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/pkgs/tools/networking/nxdomain/default.nix b/pkgs/tools/networking/nxdomain/default.nix
new file mode 100644
index 00000000000..073ac48b8d3
--- /dev/null
+++ b/pkgs/tools/networking/nxdomain/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildPythonApplication, fetchPypi, dnspython, pytestCheckHook }:
+
+buildPythonApplication rec {
+  pname = "nxdomain";
+  version = "1.0.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1z9iffggqq2kw6kpnj30shi98cg0bkvkwpglmhnkgwac6g55n2zn";
+  };
+
+  propagatedBuildInputs = [ dnspython ];
+
+  checkInputs = [ pytestCheckHook ];
+
+  postCheck = ''
+    echo example.org > simple.list
+    python -m nxdomain --format dnsmasq --out dnsmasq.conf --simple ./simple.list
+    grep -q 'address=/example.org/' dnsmasq.conf
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/zopieux/nxdomain";
+    description = "A domain (ad) block list creator";
+    platforms = platforms.all;
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ zopieux ];
+  };
+}