anchor.diff:      ] ++ optional (cfg.appendNameservers == [] || cfg.insertNameservers == [])
              { source = overrideNameserversScript;
                target = "NetworkManager/dispatcher.d/02overridedns";
  -           };
  +           }
  +      ++ lib.imap (i: s: {
  +        text = s.source;
  +        target = "NetworkManager/dispatcher.d/${dispatcherTypesSubdirMap.${s.type}}03userscript${lib.fixedWidthNumber 4 i}";
  +      }) cfg.dispatcherScripts;
   
       environment.systemPackages = cfg.packages ++ [
           networkmanager_openvpn
  
positive.code:     ${coreutils}/bin/rm -f $tmp $tmp.ns
    '';
  
  in {
  
    ###### interface
  
negative.code:         '';
        };
  
        dispatcherScripts = mkOption {
          type = types.listOf (types.submodule {
            options = {
              source = mkOption {
                type = types.str;
                description = ''
                  A script source.
                '';
              };
  
              type = mkOption {
                type = types.enum (attrNames dispatcherTypesSubdirMap); 
                default = "basic";
                description = ''
                  Dispatcher hook type. Only basic hooks are currently available.
                '';
              };
            };
          });
          default = [];
          description = ''
            A list of scripts which will be executed in response to  network  events.
          '';
        };
      };
    };
  
  