summaryrefslogtreecommitdiff
path: root/packages/myip.nix
blob: d40e1fdd51eef7013edffd5bc81369084be264f7 (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
{
  dnsutils,
  lib,
  writeShellApplication,
}:
writeShellApplication {
  name = "myip";

  runtimeInputs = [ dnsutils ];

  text = ''
    dig -4 +short @resolver1.opendns.com myip.opendns.com A
    dig -6 +short @resolver1.opendns.com myip.opendns.com AAAA
  '';

  meta = with lib; {
    description = "A dumb tool to get host's current public IP";
    homepage = "https://git.azahi.cc/nixfiles";
    license = licenses.wtfpl;
    platforms = platforms.unix;
    maintainers = with maintainers; [ azahi ];
    mainProgram = "myip";
  };
}