Compare commits
4 Commits
d34919766a
...
44ea683391
Author | SHA1 | Date |
---|---|---|
|
44ea683391 | |
|
725d8b608f | |
|
bc9ced5d38 | |
|
73ae7788b9 |
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
********
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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" ]; };
|
||||
};
|
||||
};
|
||||
}
|
|
@ -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' ;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue