summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/dn/dnst/package.nix
blob: 099b7647a114558b4e70cdce9774c66f1698ce2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{
  lib,
  fetchFromGitHub,
  rustPlatform,
  pkg-config,
  openssl,
  installShellFiles,
  makeWrapper,
  nix-update-script,
}:
rustPlatform.buildRustPackage (finalAttrs: {
  pname = "dnst";
  version = "0.2.0-alpha3";
  __structuredAttrs = true;

  src = fetchFromGitHub {
    owner = "NLnetLabs";
    repo = "dnst";
    tag = "v${finalAttrs.version}";
    hash = "sha256-6Sgj2OZptG/bMsuYdGfaaY62qh4uUyxdbit6vpWWm9w=";
  };

  nativeBuildInputs = [
    pkg-config
    installShellFiles
    makeWrapper
  ];
  buildInputs = [ openssl ];

  cargoHash = "sha256-8pzf4GeBJbqIZf6KAqROEAvFAqtf6XLODWhS3RVfpAQ=";

  postInstall = ''
    mkdir -p $out/libexec
    mv $out/bin/ldns $out/libexec
    for tool in key2ds keygen notify nsec3-hash signzone; do
      makeWrapper $out/libexec/ldns $out/bin/ldns-$tool --add-flag ldns-$tool
    done

    installManPage doc/manual/build/man/*.1
  '';

  passthru.updateScript = nix-update-script {
    extraArgs = [ "--version=unstable" ];
  };

  meta = {
    description = "Toolset to assist DNS operators with zone and nameserver maintenance";
    mainProgram = "dnst";
    homepage = "https://nlnetlabs.nl/projects/domain/dnst/";
    changelog = "https://github.com/NLnetLabs/dnst/blob/v${finalAttrs.version}/Changelog.md";
    license = lib.licenses.bsd3;
    maintainers = [ lib.maintainers.skyesoss ];
  };
})