Merge pull request #9825 from ericsagnes/connman-conf

connman: improved configuration

+23 -1
+23 -1
nixos/modules/services/networking/connman.nix
··· 5 5 6 6 let 7 7 cfg = config.networking.connman; 8 + configFile = pkgs.writeText "connman.conf" '' 9 + [General] 10 + NetworkInterfaceBlacklist=${concatStringsSep "," cfg.networkInterfaceBlacklist} 8 11 12 + ${cfg.extraConfig} 13 + ''; 9 14 in { 10 15 11 16 ###### interface ··· 22 27 ''; 23 28 }; 24 29 30 + extraConfig = mkOption { 31 + type = types.lines; 32 + default = '' 33 + ''; 34 + description = '' 35 + Configuration lines appended to the generated connman configuration file. 36 + ''; 37 + }; 38 + 39 + networkInterfaceBlacklist = mkOption { 40 + type = with types; listOf string; 41 + default = [ "vmnet" "vboxnet" "virbr" "ifb" "ve" ]; 42 + description = '' 43 + Default blacklisted interfaces, this includes NixOS containers interfaces (ve). 44 + ''; 45 + }; 46 + 25 47 }; 26 48 27 49 }; ··· 51 73 Type = "dbus"; 52 74 BusName = "net.connman"; 53 75 Restart = "on-failure"; 54 - ExecStart = "${pkgs.connman}/sbin/connmand --nodaemon"; 76 + ExecStart = "${pkgs.connman}/sbin/connmand --config=${configFile} --nodaemon"; 55 77 StandardOutput = "null"; 56 78 }; 57 79 };