nixos/connman: add option to use specific package

+11 -4
+11 -4
nixos/modules/services/networking/connman.nix
··· 77 ''; 78 }; 79 80 }; 81 82 }; ··· 93 message = "You can not use services.connman with networking.networkmanager"; 94 }]; 95 96 - environment.systemPackages = [ connman ]; 97 98 systemd.services.connman = { 99 description = "Connection service"; ··· 105 BusName = "net.connman"; 106 Restart = "on-failure"; 107 ExecStart = toString ([ 108 - "${pkgs.connman}/sbin/connmand" 109 "--config=${configFile}" 110 "--nodaemon" 111 ] ++ optional enableIwd "--wifi=iwd_agent" ··· 122 serviceConfig = { 123 Type = "dbus"; 124 BusName = "net.connman.vpn"; 125 - ExecStart = "${pkgs.connman}/sbin/connman-vpnd -n"; 126 StandardOutput = "null"; 127 }; 128 }; ··· 132 serviceConfig = { 133 Name = "net.connman.vpn"; 134 before = [ "connman" ]; 135 - ExecStart = "${pkgs.connman}/sbin/connman-vpnd -n"; 136 User = "root"; 137 SystemdService = "connman-vpn.service"; 138 };
··· 77 ''; 78 }; 79 80 + package = mkOption { 81 + type = types.path; 82 + description = "The connman package / build flavor"; 83 + default = connman; 84 + example = literalExample "pkgs.connmanFull"; 85 + }; 86 + 87 }; 88 89 }; ··· 100 message = "You can not use services.connman with networking.networkmanager"; 101 }]; 102 103 + environment.systemPackages = [ cfg.package ]; 104 105 systemd.services.connman = { 106 description = "Connection service"; ··· 112 BusName = "net.connman"; 113 Restart = "on-failure"; 114 ExecStart = toString ([ 115 + "${cfg.package}/sbin/connmand" 116 "--config=${configFile}" 117 "--nodaemon" 118 ] ++ optional enableIwd "--wifi=iwd_agent" ··· 129 serviceConfig = { 130 Type = "dbus"; 131 BusName = "net.connman.vpn"; 132 + ExecStart = "${cfg.package}/sbin/connman-vpnd -n"; 133 StandardOutput = "null"; 134 }; 135 }; ··· 139 serviceConfig = { 140 Name = "net.connman.vpn"; 141 before = [ "connman" ]; 142 + ExecStart = "${cfg.package}/sbin/connman-vpnd -n"; 143 User = "root"; 144 SystemdService = "connman-vpn.service"; 145 };