1 { config, lib, pkgs, ... }:
14 description = lib.mdDoc ''
15 Enable this option to support USB WWAN adapters.
23 config = mkIf config.hardware.usbWwan.enable {
24 # Attaches device specific handlers.
25 services.udev.packages = with pkgs; [ usb-modeswitch-data ];
27 # Triggered by udev, usb-modeswitch creates systemd services via a
28 # template unit in the usb-modeswitch package.
29 systemd.packages = with pkgs; [ usb-modeswitch ];
31 # The systemd service requires the usb-modeswitch-data. The
32 # usb-modeswitch package intends to discover this via the
33 # filesystem at /usr/share/usb_modeswitch, and merge it with user
34 # configuration in /etc/usb_modeswitch.d. Configuring the correct
35 # path in the package is difficult, as it would cause a cyclic
37 environment.etc."usb_modeswitch.d".source = "${pkgs.usb-modeswitch-data}/share/usb_modeswitch";