Skip to content

Instantly share code, notes, and snippets.

@Informatic
Created September 6, 2022 16:33
Show Gist options
  • Save Informatic/7e025c496e66771436fc32acbbd61e1b to your computer and use it in GitHub Desktop.
Save Informatic/7e025c496e66771436fc32acbbd61e1b to your computer and use it in GitHub Desktop.
networking.networkmanager = {
enable = true;
# Let's just use networkmanager for modem support for now
unmanaged = [ "wlan0" ];
};
systemd.services.NetworkManager.requires = [ "ModemManager.service" ];
systemd.services.ModemManager.requires = [ "rmtfs.service" ];
# Workaround broken sim detection on UF896
systemd.services.qmi-uim-powercycle = {
enable = true;
after = [ "sys-subsystem-net-devices-wwan0.device"]; # dev-wwan0qmi0.device" ];
bindsTo = [ "sys-subsystem-net-devices-wwan0.device"]; # dev-wwan0qmi0.device" ];
before = [ "ModemManager.service" ];
wantedBy = [ "ModemManager.service" ];
path = [ pkgs.libqmi ];
script = ''
qmicli -pd /dev/wwan0qmi0 --uim-sim-power-off=1 && qmicli -pd /dev/wwan0qmi0 --uim-sim-power-on=1
'';
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment