about summary refs log tree commit diff
path: root/packages/myip.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--packages/myip.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/myip.nix b/packages/myip.nix
new file mode 100644
index 0000000..a830139
--- /dev/null
+++ b/packages/myip.nix
@@ -0,0 +1,12 @@
+{
+  dnsutils,
+  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
+  '';
+}

Consider giving Nix/NixOS a try! <3