anchor.diff:  assert stdenv.lib.asserts.assertOneOf "firewallType" firewallType [ "iptables" "nftables" ];
   assert stdenv.lib.asserts.assertOneOf "dnsType" dnsType [ "internal" "systemd-resolved" ];
   
  +let inherit (stdenv.lib) optionals; 
  +
   stdenv.mkDerivation rec {
     pname = "connman";
     version = "1.38";
  
positive.code:     # --enable-tests # installs the tests, we don't want that
      "--enable-tools"
    ]
      ++ stdenv.lib.optionals (!enableLoopback) [ "--disable-loopback" ]
      ++ stdenv.lib.optionals (!enableEthernet) [ "--disable-ethernet" ]
      ++ stdenv.lib.optionals (!enableWireguard) [ "--disable-wireguard" ]
      ++ stdenv.lib.optionals (!enableGadget) [ "--disable-gadget" ]
      ++ stdenv.lib.optionals (!enableWifi) [ "--disable-wifi" ]
      # enable IWD support for wifi as it doesn't require any new dependencies
      # and it's easier for the NixOS module to use only one connman package when
      # IWD is requested
      ++ stdenv.lib.optionals (enableWifi) [ "--enable-iwd" ]
      ++ stdenv.lib.optionals (!enableBluetooth) [ "--disable-bluetooth" ]
      ++ stdenv.lib.optionals (!enableOfono) [ "--disable-ofono" ]
      ++ stdenv.lib.optionals (!enableDundee) [ "--disable-dundee" ]
      ++ stdenv.lib.optionals (!enablePacrunner) [ "--disable-pacrunner" ]
      ++ stdenv.lib.optionals (!enableNeard) [ "--disable-neard" ]
      ++ stdenv.lib.optionals (!enableWispr) [ "--disable-wispr" ]
      ++ stdenv.lib.optionals (!enableTools) [ "--disable-tools" ]
      ++ stdenv.lib.optionals (!enableStats) [ "--disable-stats" ]
      ++ stdenv.lib.optionals (!enableClient) [ "--disable-client" ]
      ++ stdenv.lib.optionals (!enableDatafiles) [ "--disable-datafiles" ]
      ++ stdenv.lib.optionals (enableOpenconnect) [
        "--enable-openconnect=builtin"
        "--with-openconnect=${openconnect}/sbin/openconnect"
      ]
      ++ stdenv.lib.optionals (enableOpenvpn) [
        "--enable-openvpn=builtin"
        "--with-openvpn=${openvpn}/sbin/openvpn"
      ]
      ++ stdenv.lib.optionals (enableVpnc) [
        "--enable-vpnc=builtin"
        "--with-vpnc=${vpnc}/sbin/vpnc"
      ]
      ++ stdenv.lib.optionals (enablePolkit) [
        "--enable-polkit"
      ]
      ++ stdenv.lib.optionals (enablePptp) [
        "--enable-pptp"
        "--with-pptp=${pptp}/sbin/pptp"
      ]
      ++ stdenv.lib.optionals (!enableWireguard) [
        "--disable-wireguard"
      ]
      ++ stdenv.lib.optionals (enableNetworkManager) [
        "--enable-nmcompat"
      ]
      ++ stdenv.lib.optionals (enableHh2serialGps) [
        "--enable-hh2serial-gps"
      ]
      ++ stdenv.lib.optionals (enableL2tp) [
        "--enable-l2tp"
      ]
      ++ stdenv.lib.optionals (enableIospm) [
        "--enable-iospm"
      ]
      ++ stdenv.lib.optionals (enableTist) [
        "--enable-tist"
      ]
    ;
  
negative.code:     pkgconfig
      file
    ]
      ++ optionals (enableOpenvpn) [ openvpn ]
      ++ optionals (enableOpenconnect) [ openconnect ]
      ++ optionals (enableVpnc) [ vpnc ]
      ++ optionals (enablePolkit) [ polkit ]
      ++ optionals (enablePptp) [ pptp ppp ]
      ++ optionals (firewallType == "iptables") [ iptables ]
      ++ optionals (firewallType == "nftables") [ libnftnl ]
    ;
  
    # fix invalid path to 'file'
  