Merge pull request #9825 from ericsagnes/connman-conf

connman: improved configuration

+23 -1
+23 -1
nixos/modules/services/networking/connman.nix
··· 5 6 let 7 cfg = config.networking.connman; 8 9 in { 10 11 ###### interface ··· 22 ''; 23 }; 24 25 }; 26 27 }; ··· 51 Type = "dbus"; 52 BusName = "net.connman"; 53 Restart = "on-failure"; 54 - ExecStart = "${pkgs.connman}/sbin/connmand --nodaemon"; 55 StandardOutput = "null"; 56 }; 57 };
··· 5 6 let 7 cfg = config.networking.connman; 8 + configFile = pkgs.writeText "connman.conf" '' 9 + [General] 10 + NetworkInterfaceBlacklist=${concatStringsSep "," cfg.networkInterfaceBlacklist} 11 12 + ${cfg.extraConfig} 13 + ''; 14 in { 15 16 ###### interface ··· 27 ''; 28 }; 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 + 47 }; 48 49 }; ··· 73 Type = "dbus"; 74 BusName = "net.connman"; 75 Restart = "on-failure"; 76 + ExecStart = "${pkgs.connman}/sbin/connmand --config=${configFile} --nodaemon"; 77 StandardOutput = "null"; 78 }; 79 };