Compare commits

...

4 Commits

Author SHA1 Message Date
Daniel Barlow 44ea683391 think 2024-07-14 12:08:02 +01:00
Daniel Barlow 725d8b608f huawei-cdc-ncm kernel driver -> module 2024-07-14 12:07:28 +01:00
Daniel Barlow bc9ced5d38 fix doc ref from admin section -> configuration 2024-07-14 11:56:35 +01:00
Daniel Barlow 73ae7788b9 rename wwan-related modules/services
we only currently support huawei e3372/cdc ncm so let's make that
explicit in the naming
2024-07-14 11:53:45 +01:00
7 changed files with 62 additions and 36 deletions

View File

@ -5392,3 +5392,11 @@ we also need to expunge all mention of kexec
and mention the upgrade choices in the Configuration section so
people don't build an unupgradable image and only find out later
Fri Jul 12 21:20:00 BST 2024
generalising the failover example:
- usb stick may or may not need a modeswitch
- may need a different chat script
- usb ids

View File

@ -5,9 +5,12 @@ Services on a running system
****************************
Liminix services are built on s6-rc, which is itself layered on s6.
See configuration / services node for how to specify them.
Services are defined at build time in your configuration (see
:ref:`configuration-services` for information) and can't be added
to/changed at runtime, but to monitor
events or diagnose problems you may need to inspect them on the
running system. Here are some of the most commonly used s6,-rc
commands:
.. list-table:: Service management quick reference
:widths: 55 45

View File

@ -86,6 +86,7 @@ domains, or you want to run two SSH daemons on different ports.
don't use the NixOS modules themselves, because the
underlying system is not similar enough for them to work.
.. _configuration-services:
Services
********

View File

@ -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";

View File

@ -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" ]; };
};
};
}

45
modules/wwan/default.nix Normal file
View File

@ -0,0 +1,45 @@
{ config, pkgs, lib, ... }:
let
inherit (pkgs) liminix;
inherit (lib) mkOption types;
huawei-cdc-ncm = pkgs.kmodloader.override {
targets = ["huawei_cdc_ncm"];
inherit (config.system.outputs) kernel;
};
in {
imports = [
../service-trigger
];
options = {
system.service.wwan.huawei-e3372 = mkOption {
type = liminix.lib.types.serviceDefn;
};
};
config = {
kernel.config = {
USB_NET_HUAWEI_CDC_NCM = "m";
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 =
let svc = 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" ]; };
};
in
svc // {
build = args :
let args' = args // {
dependencies = (args.dependencies or []) ++
[huawei-cdc-ncm];
};
in svc.build args' ;
};
};
}