···21 ###### implementation
2223 config = mkIf config.hardware.usbWwan.enable {
24+ # Attaches device specific handlers.
25 services.udev.packages = with pkgs; [ usb-modeswitch-data ];
26+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 ];
30+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
36+ # dependency.
37+ environment.etc."usb_modeswitch.d".source = "${pkgs.usb-modeswitch-data}/share/usb_modeswitch";
38 };
39}
···9 sha256 = "0b1wari3aza6qjggqd0hk2zsh93k1q8scgmwh6f8wr0flpr3whff";
10 };
1112- inherit (usb-modeswitch) makeFlags;
0001314 prePatch = ''
15- sed -i 's@usb_modeswitch@${usb-modeswitch}/bin/usb_modeswitch@g' 40-usb_modeswitch.rules
16 '';
1718 # we add tcl here so we can patch in support for new devices by dropping config into
···9 sha256 = "0b1wari3aza6qjggqd0hk2zsh93k1q8scgmwh6f8wr0flpr3whff";
10 };
1112+ makeFlags = [
13+ "PREFIX=$(out)"
14+ "DESTDIR=$(out)"
15+ ];
1617 prePatch = ''
18+ sed -i 's@usb_modeswitch@${usb-modeswitch}/lib/udev/usb_modeswitch@g' 40-usb_modeswitch.rules
19 '';
2021 # we add tcl here so we can patch in support for new devices by dropping config into