1{
2 lib,
3 buildPythonApplication,
4 fetchPypi,
5 dnspython,
6 pytestCheckHook,
7}:
8
9buildPythonApplication rec {
10 pname = "nxdomain";
11 version = "1.0.2";
12 format = "setuptools";
13
14 src = fetchPypi {
15 inherit pname version;
16 sha256 = "0va7nkbdjgzrf7fnbxkh1140pbc62wyj86rdrrh5wmg3phiziqkb";
17 };
18
19 propagatedBuildInputs = [ dnspython ];
20
21 nativeCheckInputs = [ pytestCheckHook ];
22
23 postCheck = ''
24 echo example.org > simple.list
25 python -m nxdomain --format dnsmasq --out dnsmasq.conf --simple ./simple.list
26 grep -q 'address=/example.org/' dnsmasq.conf
27 '';
28
29 meta = with lib; {
30 homepage = "https://github.com/zopieux/nxdomain";
31 description = "Domain (ad) block list creator";
32 mainProgram = "nxdomain";
33 platforms = platforms.all;
34 license = licenses.gpl3Only;
35 maintainers = with maintainers; [ zopieux ];
36 };
37}