nixphone stuff
This commit is contained in:
parent
0348ef1e6a
commit
f0fca1bad4
1 changed files with 433 additions and 236 deletions
34
modules/mobile/usb-network.nix
Normal file
34
modules/mobile/usb-network.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
imports = [ "${inputs.gadgetfs}/usb-gadget.nix" ];
|
||||
|
||||
hardware.usb-gadget = {
|
||||
enable = true;
|
||||
gadgets.g = {
|
||||
default = true;
|
||||
product = "quadphone";
|
||||
functions.ecm.usb0 = {
|
||||
deviceAddress = "02:00:00:00:42:01";
|
||||
hostAddress = "02:00:00:00:42:02";
|
||||
};
|
||||
configs.def = {
|
||||
id = 1;
|
||||
functions = [ "ecm.usb0" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
networking.networkmanager.ensureProfiles.profiles.usb-network = {
|
||||
connection = {
|
||||
id = "USB network";
|
||||
type = "ethernet";
|
||||
interface-name = "usb0";
|
||||
};
|
||||
ipv4 = {
|
||||
method = "manual";
|
||||
address1 = "172.16.42.1/24";
|
||||
never-default = true;
|
||||
};
|
||||
ipv6.method = "disabled";
|
||||
};
|
||||
}
|
||||
Loading…
Reference in a new issue