diff --git a/hosts/by-name/moby/default.nix b/hosts/by-name/moby/default.nix index 042a4ade0..e8de23bcf 100644 --- a/hosts/by-name/moby/default.nix +++ b/hosts/by-name/moby/default.nix @@ -38,6 +38,9 @@ sane.gui.sxmo.enable = true; sane.services.eg25-manager.enable = true; + # i only need eg25-manager for GPS purposes; + # but modemmanager outright fails -- blocking eg25-manager -- unless i provide it a sim. + sane.services.eg25-manager.package = pkgs.eg25-manager.override { withModemManager = false; }; sane.programs.guiApps.suggestedPrograms = [ "handheldGuiApps" ]; # sane.programs.consoleUtils.enableFor.user.colin = false; # sane.programs.guiApps.enableFor.user.colin = false; diff --git a/modules/services/eg25-manager.nix b/modules/services/eg25-manager.nix index d4f1536ae..07f997dc1 100644 --- a/modules/services/eg25-manager.nix +++ b/modules/services/eg25-manager.nix @@ -12,20 +12,25 @@ let ''; in { - options.sane.services.eg25-manager = { - enable = lib.mkEnableOption "Quectel EG25 modem manager service"; + options.sane.services.eg25-manager = with lib; { + enable = mkEnableOption "Quectel EG25 modem manager service"; + package = mkOption { + type = types.package; + default = pkgs.eg25-manager; + }; }; config = lib.mkIf cfg.enable { # eg25-manager package ships udev rules *and* a systemd service. # for that reason, i think it needs to be on the system path for the systemd service to be enabled. - services.udev.packages = [ pkgs.eg25-manager ]; + services.udev.packages = [ cfg.package ]; # but actually, let's define our own systemd service so that we can control config systemd.services.eg25-manager = { serviceConfig = { Type = "simple"; - ExecStart = "${pkgs.eg25-manager}/bin/eg25-manager --config ${eg25-config-toml}"; + ExecStart = "${cfg.package}/bin/eg25-manager --config ${eg25-config-toml}"; ExecStartPre = pkgs.writeShellScript "unload-modem-power" '' + # see issue: ${pkgs.kmod}/bin/modprobe -r modem_power && echo "WARNING: kernel configured with CONFIG_MODEM_POWER=y, may be incompatible with eg25-manager" || true ''; diff --git a/pkgs/additional/eg25-manager/default.nix b/pkgs/additional/eg25-manager/default.nix index 7e5db5140..df2fc6848 100644 --- a/pkgs/additional/eg25-manager/default.nix +++ b/pkgs/additional/eg25-manager/default.nix @@ -14,7 +14,8 @@ , glib , libgudev , libusb1 -, modemmanager +# if true, build with MMGLIB. if false, eg25-manager won't speak to modemmanager and will be usable standalone +, withModemManager ? true, modemmanager }: let @@ -59,6 +60,7 @@ stdenv.mkDerivation rec { libgpiod1 libgudev libusb1 + ] ++ lib.optionals withModemManager [ modemmanager ];