liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 73ae7788b96852b221989aaf0206d8fc4bad35d2
parent d34919766a8d063a430b3a9ad77873c1aa9be407
Author: Daniel Barlow <dan@telent.net>
Date:   Sun, 14 Jul 2024 11:53:45 +0100

rename wwan-related modules/services

we only currently support huawei e3372/cdc ncm so let's make that
explicit in the naming

Diffstat:
Mexamples/l2tp.nix | 4++--
Dmodules/cdc-ncm/default.nix | 31-------------------------------
Amodules/wwan/default.nix | 31+++++++++++++++++++++++++++++++
Rmodules/cdc-ncm/wwan.nix -> modules/wwan/huawei-e3372.nix | 0
4 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/examples/l2tp.nix b/examples/l2tp.nix @@ -39,7 +39,7 @@ in rec { }; imports = [ - ../modules/cdc-ncm + ../modules/wwan ../modules/network ../modules/vlan ../modules/ssh @@ -50,7 +50,7 @@ in rec { ]; hostname = "thing"; - services.wwan = svc.wwan.build { + services.wwan = svc.wwan.huawei-e3372.build { apn = "data.uk"; username = "user"; password = "one2one"; diff --git a/modules/cdc-ncm/default.nix b/modules/cdc-ncm/default.nix @@ -1,31 +0,0 @@ -{ config, pkgs, lib, ... }: -let - inherit (pkgs) liminix; - inherit (lib) mkOption types; -in { - imports = [ - ../service-trigger - ]; - - options = { - system.service.wwan = mkOption { - type = liminix.lib.types.serviceDefn; - }; - }; - config = { - kernel.config = { - USB_NET_HUAWEI_CDC_NCM = "y"; - USB_USBNET = "y"; - USB_SERIAL = "y"; - USB_SERIAL_OPTION = "y"; - }; - - # https://www.0xf8.org/2017/01/flashing-a-huawei-e3372h-4g-lte-stick-from-hilink-to-stick-mode/ - system.service.wwan = config.system.callService ./wwan.nix { - apn = mkOption { type = types.str; }; - username = mkOption { type = types.str; }; - password = mkOption { type = types.str; }; - authType = mkOption { type = types.enum [ "pap" "chap" ]; }; - }; - }; -} diff --git a/modules/wwan/default.nix b/modules/wwan/default.nix @@ -0,0 +1,31 @@ +{ config, pkgs, lib, ... }: +let + inherit (pkgs) liminix; + inherit (lib) mkOption types; +in { + imports = [ + ../service-trigger + ]; + + options = { + system.service.wwan.huawei-e3372 = mkOption { + type = liminix.lib.types.serviceDefn; + }; + }; + config = { + kernel.config = { + USB_NET_HUAWEI_CDC_NCM = "y"; + USB_USBNET = "y"; + USB_SERIAL = "y"; + USB_SERIAL_OPTION = "y"; + }; + + # https://www.0xf8.org/2017/01/flashing-a-huawei-e3372h-4g-lte-stick-from-hilink-to-stick-mode/ + system.service.wwan.huawei-e3372 = config.system.callService ./huawei-e3372.nix { + apn = mkOption { type = types.str; }; + username = mkOption { type = types.str; }; + password = mkOption { type = types.str; }; + authType = mkOption { type = types.enum [ "pap" "chap" ]; }; + }; + }; +} diff --git a/modules/cdc-ncm/wwan.nix b/modules/wwan/huawei-e3372.nix