ctucx.git: dns.nix

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

commit bb554091237f959c4e34db958c355d24653bb6b8
parent 6010977e38e694dd564f2cfa2523134ef1087ab8
Author: Kirill Elagin <kirelagin@gmail.com>
Date: Tue, 30 Mar 2021 21:26:01 -0400

Merge pull request #8 from petabyteboy/feature/ptr

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"