anchor.diff:    ###### implementation
   
     config = mkIf cfg.enable {
  -
  -    jobs = listToAttrs (map (c: nameValuePair "openvpn-${cfg.id}" (makeOpenVPNJob c)) cfg.servers);
  -  
  +    jobs = listToAttrs (mapAttrsFlatten (name: value: nameValuePair "openvpn-${name}" (makeOpenVPNJob value name)) cfg.servers);
     };
     
   }
  
positive.code: 
        script =
          ''
            exec &> /var/log/openvpn-${cfg.id}
            ${config.system.sbin.modprobe} tun || true
            ${openvpn}/sbin/openvpn --config ${configFile}
          '';
      };
  
  in
    
  
negative.code:         description = "Whether to enable OpenVPN.";
        };
  
  
        servers = mkOption {
  
          default = {};
  
          example = {
              mostSimple = {
                config = ''
                  # Most simple 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 static.key
                '';
                up = "ip route add ..!";
                down = "ip route add ..!";
              };
              clientMostSimple = {
                config = ''
                  #client:
                  #remote myremote.mydomain
                  #dev tun
                  #ifconfig 10.8.0.2 10.8.0.1
                  #secret static.key
                '';
              };
              serverScalable = {
                config = ''
                  multiple clienst
                  see example file found in http://openvpn.net/index.php/documentation/howto.html
                '';
              };
          };
  
          # !!! clean up this description please
          description = ''
            You can define multiple openvpn instances.
  
            The id of an instance is given by the attribute name.
  
            Each instance will result in a new job file.
  
            Additionally you can specify the up/ down scripts by setting
            the up down properties. 
            Config lines up=/nix/store/xxx-up-script down=...
            will be appended to your configuration file automatically
  
            If you define at least one of up/down "script-security 2" will be
            prepended to your config otherwise you scripts aren't run by openvpn
  
            Don't forget to check that the all package sizes can be sent. For
            examlpe if scp hangs you should set --fragment XXX --mssfix YYY.
          '';
  
          type = types.attrsOf types.optionSet;
          options = [ openvpnInstanceOptions ];
        };
  
      };
  
    };
  