Merge pull request #330260 from Luflosi/add/eg25-manager

eg25-manager: init at 0.4.6
This commit is contained in:
Sandro 2024-08-03 18:23:27 +02:00 committed by GitHub
commit 03dfa4c1da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 92 additions and 0 deletions

View File

@ -0,0 +1,27 @@
{
config,
lib,
pkgs,
...
}:
let
inherit (lib) mkEnableOption mkIf mkPackageOption;
cfg = config.services.eg25-manager;
in
{
options.services.eg25-manager = {
enable = mkEnableOption "Quectel EG25 modem manager service";
package = mkPackageOption pkgs "eg25-manager" { };
};
config = mkIf cfg.enable {
systemd.packages = [ cfg.package ];
services.udev.packages = [ cfg.package ];
systemd.services.eg25-manager.wantedBy = [ "multi-user.target" ];
};
meta = {
maintainers = with lib.maintainers; [ Luflosi ];
};
}

View File

@ -81,6 +81,7 @@
./hardware/mcelog.nix
./hardware/network/ath-user-regd.nix
./hardware/network/b43.nix
./hardware/network/eg25-manager.nix
./hardware/network/intel-2200bg.nix
./hardware/new-lg4ff.nix
./hardware/nitrokey.nix

View File

@ -0,0 +1,64 @@
{
lib,
stdenv,
fetchFromGitLab,
gnugrep,
meson,
ninja,
pkg-config,
scdoc,
curl,
glib,
libgpiod_1,
libgudev,
libusb1,
modemmanager,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "eg25-manager";
version = "0.4.6";
src = fetchFromGitLab {
owner = "mobian1";
repo = "eg25-manager";
rev = finalAttrs.version;
hash = "sha256-2JsdwK1ZOr7ljNHyuUMzVCpl+HV0C5sA5LAOkmELqag=";
};
postPatch = ''
substituteInPlace 'udev/80-modem-eg25.rules' \
--replace-fail '/bin/grep' '${lib.getExe gnugrep}'
'';
depsBuildBuild = [ pkg-config ];
nativeBuildInputs = [
glib # Contains gdbus-codegen program
meson
ninja
pkg-config
scdoc
];
buildInputs = [
curl
glib
libgpiod_1 # Tracking issue for compatibility with libgpiod 2.0: https://gitlab.com/mobian1/eg25-manager/-/issues/45
libgudev
libusb1
modemmanager
];
strictDeps = true;
meta = {
description = "Manager daemon for the Quectel EG25 mobile broadband modem found on the Pine64 PinePhone and PinePhone Pro";
homepage = "https://gitlab.com/mobian1/eg25-manager";
changelog = "https://gitlab.com/mobian1/eg25-manager/-/tags/${finalAttrs.version}";
license = lib.licenses.gpl3Plus;
mainProgram = "eg25-manager";
maintainers = with lib.maintainers; [ Luflosi ];
platforms = lib.platforms.linux;
};
})