git: ignore formatting with nixfmt-rfc-style
[julm/julm-nix.git] / nixos / profiles / hardware / ME909u-521.nix
index 90f40c19a6833765f7224fd978f72c19f3afdb26..31fc779e94952f9f0c9053b79fe4f8abc36ec31c 100644 (file)
@@ -1,24 +1,29 @@
 # Configuration for the ME909u-521 mini PCIe card (12d1:1573)
 # Beware that productId=1573 has been reused by Huawei for other cards...
-{ pkgs, lib, config, ... }:
+{ pkgs, lib, ... }:
 {
-# Enable usb_modeswitch
-hardware.usbWwan.enable = true;
+  # sudo mmcli -m --command=
+  # - AT^WAKEUPCFG=?
+  # - Restart the module: AT+CFUN=1,1
+  # - Power off the module: AT^MSO
+  # - Set the +CREG unsolicited indication: AT+CREG=1
+  #
+  # sudo mmcli --modem 0 --set-allowed-modes='2G|3G|4G' --set-preferred-mode=4G
+  networking.networkmanager.enable = true;
 
-# Enable ModemManager
-networking.networkmanager.enable = true;
+  # Enable usb_modeswitch
+  hardware.usb-modeswitch.enable = true;
+  # https://forum.openwrt.org/t/cdc-ether-ethertype-unknown-0x0808-on-huawei-me909u-521/5509/2
+  # https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/635
+  environment.etc."usb_modeswitch.d".source = lib.mkForce (
+    pkgs.writeTextDir "12d1:1573" ''
+      # Huawei ME909u-521: select the QMI interface, which has qmi_wwan_rx_fixup()
+      Configuration=1
+    ''
+  );
 
-# https://forum.openwrt.org/t/cdc-ether-ethertype-unknown-0x0808-on-huawei-me909u-521/5509/2
-# https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/635
-environment.etc."usb_modeswitch.d".source = lib.mkForce (pkgs.writeTextDir "12d1:1573" ''
-  # Huawei ME909u-521: select the QMI interface, which has qmi_wwan_rx_fixup()
-  Configuration=1
-'');
-
-# sudo mmcli --modem 0 --set-allowed-modes='2G|3G|4G' --set-preferred-mode=4G
-
-environment.systemPackages = [
-  pkgs.libqmi
-];
+  environment.systemPackages = [
+    pkgs.libqmi
+  ];
 
 }