summary refs log tree commit diff
path: root/nixos/modules/services/networking/nsd.nix
diff options
context:
space:
mode:
authorChristoph Hrdinka <c.github@hrdinka.at>2016-01-19 11:10:09 +0100
committerChristoph Hrdinka <c.github@hrdinka.at>2016-02-28 09:18:11 +0100
commitc4c9019105f790252a3b996c6dad4c33393e7977 (patch)
treea4d0f8e9262e87323aa452cfa7e296e58c23fec5 /nixos/modules/services/networking/nsd.nix
parent6a096504cc8d661dc12957dbf79b6209a69d72af (diff)
downloadnixpkgs-c4c9019105f790252a3b996c6dad4c33393e7977.tar
nixpkgs-c4c9019105f790252a3b996c6dad4c33393e7977.tar.gz
nixpkgs-c4c9019105f790252a3b996c6dad4c33393e7977.tar.bz2
nixpkgs-c4c9019105f790252a3b996c6dad4c33393e7977.tar.lz
nixpkgs-c4c9019105f790252a3b996c6dad4c33393e7977.tar.xz
nixpkgs-c4c9019105f790252a3b996c6dad4c33393e7977.tar.zst
nixpkgs-c4c9019105f790252a3b996c6dad4c33393e7977.zip
nsd service: make use of literalExample
Diffstat (limited to 'nixos/modules/services/networking/nsd.nix')
-rw-r--r--nixos/modules/services/networking/nsd.nix62
1 files changed, 33 insertions, 29 deletions
diff --git a/nixos/modules/services/networking/nsd.nix b/nixos/modules/services/networking/nsd.nix
index b822a29423a..5a7bc7f748e 100644
--- a/nixos/modules/services/networking/nsd.nix
+++ b/nixos/modules/services/networking/nsd.nix
@@ -533,12 +533,13 @@ in
         };
       });
       default = {};
-      example = {
-        "tsig.example.org" = {
-          algorithm = "hmac-md5";
-          secret = "aaaaaabbbbbbccccccdddddd";
+      example = literalExample ''
+        { "tsig.example.org" = {
+            algorithm = "hmac-md5";
+            keyFile = "/path/to/my/key";
+          };
         };
-      };
+      '';
       description = ''
         Define your TSIG keys here.
       '';
@@ -668,34 +669,37 @@ in
     zones = mkOption {
       type = types.attrsOf zoneOptions;
       default = {};
-      example = {
-        "serverGroup1" = {
-          provideXFR = [ "10.1.2.3 NOKEY" ];
-          children = {
-            "example.com." = {
-              data = ''
-                $ORIGIN example.com.
-                $TTL    86400
-                @ IN SOA a.ns.example.com. admin.example.com. (
-                ...
-              '';
-            };
-            "example.org." = {
-              data = ''
-                $ORIGIN example.org.
-                $TTL    86400
-                @ IN SOA a.ns.example.com. admin.example.com. (
-                ...
-              '';
+      example = literalExample ''
+        { "serverGroup1" = {
+            provideXFR = [ "10.1.2.3 NOKEY" ];
+            children = {
+              "example.com." = {
+                data = '''
+                  $ORIGIN example.com.
+                  $TTL    86400
+                  @ IN SOA a.ns.example.com. admin.example.com. (
+                  ...
+                ''';
+              };
+              "example.org." = {
+                data = '''
+                  $ORIGIN example.org.
+                  $TTL    86400
+                  @ IN SOA a.ns.example.com. admin.example.com. (
+                  ...
+                ''';
+              };
             };
           };
-        };
 
-        "example.net." = {
-          provideXFR = [ "10.3.2.1 NOKEY" ];
-          data = ''...'';
+          "example.net." = {
+            provideXFR = [ "10.3.2.1 NOKEY" ];
+            data = '''
+              ...
+            ''';
+          };
         };
-      };
+      '';
       description = ''
         Define your zones here. Zones can cascade other zones and therefore
         inherit settings from parent zones. Look at the definition of