connman: improved configuration support

Changed files
+23 -1
nixos
modules
services
networking
+23 -1
nixos/modules/services/networking/connman.nix
···
let
cfg = config.networking.connman;
+
configFile = pkgs.writeText "connman.conf" ''
+
[General]
+
NetworkInterfaceBlacklist=${concatStringsSep "," cfg.networkInterfaceBlacklist}
+
${cfg.extraConfig}
+
'';
in {
###### interface
···
'';
};
+
extraConfig = mkOption {
+
type = types.lines;
+
default = ''
+
'';
+
description = ''
+
Configuration lines appended to the generated connman configuration file.
+
'';
+
};
+
+
networkInterfaceBlacklist = mkOption {
+
type = with types; listOf string;
+
default = [ "vmnet" "vboxnet" "virbr" "ifb" "ve" ];
+
description = ''
+
Default blacklisted interfaces, this includes NixOS containers interfaces (ve).
+
'';
+
};
+
};
};
···
Type = "dbus";
BusName = "net.connman";
Restart = "on-failure";
-
ExecStart = "${pkgs.connman}/sbin/connmand --nodaemon";
+
ExecStart = "${pkgs.connman}/sbin/connmand --config=${configFile} --nodaemon";
StandardOutput = "null";
};
};