ctucx.git: dns.nix

fork of https://github.com/kirelagin/dns.nix

commit bba020e3e69e8876253b9ba08418d1c94f92b634
parent 985797066ffaf8fb05693169c7c2c3222c704365
Author: Milan Pässler <milan@petabyte.dev>
Date: Thu, 21 Jan 2021 01:39:48 +0100

add PTR record type
2 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/dns/types/records/PTR.nix b/dns/types/records/PTR.nix
@@ -0,0 +1,25 @@
+#
+# © 2019 Kirill Elagin <kirelagin@gmail.com>
+#
+# SPDX-License-Identifier: MIT
+#
+
+{ pkgs }:
+
+let
+  inherit (pkgs.lib) mkOption types;
+
+in
+
+{
+  rtype = "PTR";
+  options = {
+    ptrdname = mkOption {
+      type = types.str;
+      example = "4-3-2-1.dynamic.example.com.";
+      description = "A <domain-name> which points to some location in the domain name space";
+    };
+  };
+  dataToString = {ptrdname, ...}: "${ptrdname}";
+  fromString = ptrdname: { inherit ptrdname; };
+}
diff --git a/dns/types/records/default.nix b/dns/types/records/default.nix
@@ -19,6 +19,7 @@ let
     "SOA"
     "SRV"
     "TXT"
+    "PTR"
 
     # DNSSEC types
     "DNSKEY"