11 ncdns = fetchFromGitHub {
14 rev = "5adda8d4726d389597df432eb2e17eac1677cea2";
15 sha256 = "sha256-Q/RrUTY4WfrByvQv1eCX29DQNf2vSIR29msmhgS73xk=";
18 # script to patch the crypto/x509 package
19 x509 = fetchFromGitHub {
21 repo = "x509-compressed";
22 rev = "2e30a62a69dac54a977410f283308df232a5d244";
23 sha256 = "sha256-/Bd1gYjguj8AiKHyiaIKT+Y3R7kq5gLZlJhY9g/xFXk=";
24 # ncdns must be put in a subdirectory for this to work.
26 cp -r --no-preserve=mode "${ncdns}" "$out/ncdns"
34 version = "unstable-2022-10-07";
38 vendorHash = "sha256-ENtTnDsz5WhRz1kiqnWQ5vyEpZtgi7ZeYvksffgW78k=";
40 # Override the goModules fetcher derivation to apply
41 # upstream's patch of the crypto/x509 library.
43 go mod init github.com/namecoin/x509-compressed
48 go mod init github.com/namecoin/ncdns
50 -replace github.com/coreos/go-systemd=github.com/coreos/go-systemd/v22@latest \
51 -replace github.com/namecoin/x509-compressed=$NIX_BUILD_TOP/source
55 # Copy over the lockfiles as well, because the source
56 # doesn't contain it. The fixed-output derivation is
57 # probably not reproducible anyway.
59 mv -t vendor go.mod go.sum
60 cp -r --reflink=auto vendor "$out"
63 buildInputs = [ libcap ];
65 # The fetcher derivation must run with a different
66 # $sourceRoot, but buildGoModule doesn't allow that,
67 # so we use this ugly hack.
72 sourceRoot=$PWD/source/ncdns
73 chmod -R u+w -- "$sourceRoot"
79 # Same as above: can't use `patches` because that would
80 # be also applied to the fetcher derivation, thus failing.
83 patch -p1 < ${./fix-tpl-path.patch}
89 mv -t . vendor/go.{mod,sum}
93 # needed to run the ncdns test suite
94 ln -s $PWD/vendor ../../go/src
99 cp -r _doc "$out/share/doc"
100 cp -r _tpl "$out/share/tpl"
103 passthru.tests.ncdns = nixosTests.ncdns;
106 description = "Namecoin to DNS bridge daemon";
107 homepage = "https://github.com/namecoin/ncdns";
108 license = licenses.gpl3Plus;
109 maintainers = with maintainers; [ rnhmjoj ];