about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/cluster/dnsname-cni/default.nix
blob: c14033382b55b30f96208c7c1f3b00a9d6354c96 (plain) (blame)
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
{
  buildGoModule,
  dnsmasq,
  fetchFromGitHub,
  lib,
  nixosTests,
  makeWrapper,
}:

buildGoModule rec {
  pname = "cni-plugin-dnsname";
  version = "1.2.0";

  src = fetchFromGitHub {
    owner = "containers";
    repo = "dnsname";
    rev = "v${version}";
    sha256 = "sha256-hHkQOHDso92gXFCz40iQ7j2cHTEAMsaeW8MCJV2Otqo=";
  };

  nativeBuildInputs = [ makeWrapper ];
  postInstall = ''
    wrapProgram $out/bin/dnsname --prefix PATH : ${lib.makeBinPath [ dnsmasq ]}
  '';

  vendorSha256 = null;
  subPackages = [ "plugins/meta/dnsname" ];

  doCheck = false; # NOTE: requires root privileges

  passthru.tests = {
    inherit (nixosTests) podman-dnsname;
  };

  meta = with lib; {
    description = "DNS name resolution for containers";
    homepage = "https://github.com/containers/dnsname";
    license = licenses.asl20;
    platforms = platforms.linux;
    maintainers = with maintainers; [ mikroskeem ];
  };
}