anchor.diff:          apply = list: [ networkmanager modemmanager wpa_supplicant ] ++ list;
         };
   
  -      overrideNameservers = mkOption {
  -        default = false;
  -        description = ''
  -          If enabled, any nameservers received by DHCP or configured in
  -          NetworkManager will be replaced by the nameservers configured
  -          in the <literal>networking.nameservers</literal> option. This
  -          option overrides the <literal>appendNameservers</literal> option
  -          if both are enabled.
  -        '';
  -      };
  -
         appendNameservers = mkOption {
  -        default = false;
  -        description = ''
  -          If enabled, the name servers configured in the
  -          <literal>networking.nameservers</literal> option will be appended
  +        type = types.listOf types.string;
  +        default = [];
  +        description = ''
  +          A list of name servers that should be appended
             to the ones configured in NetworkManager or received by DHCP.
  +        '';
  +      };
  +
  +      insertNameservers = mkOption {
  +        type = types.listOf types.string;
  +        default = [];
  +        description = ''
  +          A list of name servers that should be inserted before
  +          the ones configured in NetworkManager or received by DHCP.
           '';
         };
   
  
positive.code:       { source = "${networkmanager_openconnect}/etc/NetworkManager/VPN/nm-openconnect-service.name";
          target = "NetworkManager/VPN/nm-openconnect-service.name";
        }
      ] ++ pkgs.lib.optional (cfg.overrideNameservers || cfg.appendNameservers)
             { source = overrideNameserversScript;
               target = "NetworkManager/dispatcher.d/02overridedns";
             };
  
negative.code:     fi
    '';
  
    ns = xs: writeText "nameservers" (
      concatStrings (map (s: "nameserver ${s}\n") xs)
    );
  
    overrideNameserversScript = writeScript "02overridedns" ''
      #!/bin/sh
      tmp=`${coreutils}/bin/mktemp`
      ${gnused}/bin/sed '/nameserver /d' /etc/resolv.conf > $tmp
      ${gnugrep}/bin/grep 'nameserver ' /etc/resolv.conf | \
        ${gnugrep}/bin/grep -vf ${ns (cfg.appendNameservers ++ cfg.insertNameservers)} > $tmp.ns
      ${optionalString (cfg.appendNameservers != []) "${coreutils}/bin/cat $tmp $tmp.ns ${ns cfg.appendNameservers} > /etc/resolv.conf"}
      ${optionalString (cfg.insertNameservers != []) "${coreutils}/bin/cat $tmp ${ns cfg.insertNameservers} $tmp.ns > /etc/resolv.conf"}
      ${coreutils}/bin/rm -f $tmp $tmp.ns
    '';
  
  in {
  