]> Git — Sourcephile - julm/julm-nix.git/blob - nixos/profiles/hardware/ME909u-521.nix
aubergine: upgrade to nixos-23.11
[julm/julm-nix.git] / nixos / profiles / hardware / ME909u-521.nix
1 # Configuration for the ME909u-521 mini PCIe card (12d1:1573)
2 # Beware that productId=1573 has been reused by Huawei for other cards...
3 { pkgs, lib, ... }:
4 {
5 # sudo mmcli -m --command=
6 # - AT^WAKEUPCFG=?
7 # - Restart the module: AT+CFUN=1,1
8 # - Power off the module: AT^MSO
9 # - Set the +CREG unsolicited indication: AT+CREG=1
10 #
11 # sudo mmcli --modem 0 --set-allowed-modes='2G|3G|4G' --set-preferred-mode=4G
12 networking.networkmanager.enable = true;
13
14 # Enable usb_modeswitch
15 hardware.usb-modeswitch.enable = true;
16 # https://forum.openwrt.org/t/cdc-ether-ethertype-unknown-0x0808-on-huawei-me909u-521/5509/2
17 # https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/635
18 environment.etc."usb_modeswitch.d".source = lib.mkForce (pkgs.writeTextDir "12d1:1573" ''
19 # Huawei ME909u-521: select the QMI interface, which has qmi_wwan_rx_fixup()
20 Configuration=1
21 '');
22
23 environment.systemPackages = [
24 pkgs.libqmi
25 ];
26
27 }