Compare commits

..

No commits in common. "44ea6833910650764ac47c30690dc9fadd9ab62b" and "d34919766a8d063a430b3a9ad77873c1aa9be407" have entirely different histories.

7 changed files with 36 additions and 62 deletions

View File

@ -5392,11 +5392,3 @@ we also need to expunge all mention of kexec
and mention the upgrade choices in the Configuration section so and mention the upgrade choices in the Configuration section so
people don't build an unupgradable image and only find out later 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,12 +5,9 @@ Services on a running system
**************************** ****************************
Liminix services are built on s6-rc, which is itself layered on s6. Liminix services are built on s6-rc, which is itself layered on s6.
Services are defined at build time in your configuration (see See configuration / services node for how to specify them.
: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 .. list-table:: Service management quick reference
:widths: 55 45 :widths: 55 45

View File

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

View File

@ -39,7 +39,7 @@ in rec {
}; };
imports = [ imports = [
../modules/wwan ../modules/cdc-ncm
../modules/network ../modules/network
../modules/vlan ../modules/vlan
../modules/ssh ../modules/ssh
@ -50,7 +50,7 @@ in rec {
]; ];
hostname = "thing"; hostname = "thing";
services.wwan = svc.wwan.huawei-e3372.build { services.wwan = svc.wwan.build {
apn = "data.uk"; apn = "data.uk";
username = "user"; username = "user";
password = "one2one"; password = "one2one";

View File

@ -0,0 +1,31 @@
{ 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" ]; };
};
};
}

View File

@ -1,45 +0,0 @@
{ 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' ;
};
};
}