summary refs log tree commit diff
path: root/nixos/modules/services/networking/openvpn.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-30 16:19:07 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-30 18:47:43 +0100
commitbe5d3a59dd3684ffabf456728938ed0f6f3df59c (patch)
tree89c508fe9c473c39290ead110b70e89a1d88d61d /nixos/modules/services/networking/openvpn.nix
parent0f8b1b1a5c52a8171d9028e1df74949aea264c72 (diff)
downloadnixpkgs-be5d3a59dd3684ffabf456728938ed0f6f3df59c.tar
nixpkgs-be5d3a59dd3684ffabf456728938ed0f6f3df59c.tar.gz
nixpkgs-be5d3a59dd3684ffabf456728938ed0f6f3df59c.tar.bz2
nixpkgs-be5d3a59dd3684ffabf456728938ed0f6f3df59c.tar.lz
nixpkgs-be5d3a59dd3684ffabf456728938ed0f6f3df59c.tar.xz
nixpkgs-be5d3a59dd3684ffabf456728938ed0f6f3df59c.tar.zst
nixpkgs-be5d3a59dd3684ffabf456728938ed0f6f3df59c.zip
Clean up some option examples
Diffstat (limited to 'nixos/modules/services/networking/openvpn.nix')
-rw-r--r--nixos/modules/services/networking/openvpn.nix60
1 files changed, 30 insertions, 30 deletions
diff --git a/nixos/modules/services/networking/openvpn.nix b/nixos/modules/services/networking/openvpn.nix
index 8cc19506e21..400cb74f7d9 100644
--- a/nixos/modules/services/networking/openvpn.nix
+++ b/nixos/modules/services/networking/openvpn.nix
@@ -75,36 +75,36 @@ in
     services.openvpn.servers = mkOption {
       default = {};
 
-      example = {
-
-        server = {
-          config = ''
-            # Simplest server configuration: http://openvpn.net/index.php/documentation/miscellaneous/static-key-mini-howto.html.
-            # server :
-            dev tun
-            ifconfig 10.8.0.1 10.8.0.2
-            secret /root/static.key
-          '';
-          up = "ip route add ...";
-          down = "ip route del ...";
-        };
-
-        client = {
-          config = ''
-            client
-            remote vpn.example.org
-            dev tun
-            proto tcp-client
-            port 8080
-            ca /root/.vpn/ca.crt
-            cert /root/.vpn/alice.crt
-            key /root/.vpn/alice.key
-          '';
-          up = "echo nameserver $nameserver | ${pkgs.openresolv}/sbin/resolvconf -m 0 -a $dev";
-          down = "${pkgs.openresolv}/sbin/resolvconf -d $dev";
-        };
-
-      };
+      example = literalExample ''
+        {
+          server = {
+            config = '''
+              # Simplest server configuration: http://openvpn.net/index.php/documentation/miscellaneous/static-key-mini-howto.html.
+              # server :
+              dev tun
+              ifconfig 10.8.0.1 10.8.0.2
+              secret /root/static.key
+            ''';
+            up = "ip route add ...";
+            down = "ip route del ...";
+          };
+
+          client = {
+            config = '''
+              client
+              remote vpn.example.org
+              dev tun
+              proto tcp-client
+              port 8080
+              ca /root/.vpn/ca.crt
+              cert /root/.vpn/alice.crt
+              key /root/.vpn/alice.key
+            ''';
+            up = "echo nameserver $nameserver | ''${pkgs.openresolv}/sbin/resolvconf -m 0 -a $dev";
+            down = "''${pkgs.openresolv}/sbin/resolvconf -d $dev";
+          };
+        }
+      '';
 
       description = ''
         Each attribute of this option defines an Upstart job to run an