mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-11-26 21:09:42 +01:00
usbarmory: move to /inversepath, host support
This commit is contained in:
parent
8bf98661f4
commit
13a1d5c0bd
4 changed files with 35 additions and 0 deletions
35
inversepath/usbarmory/host.nix
Normal file
35
inversepath/usbarmory/host.nix
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
#
|
||||||
|
# Module for hosting the USB Armory
|
||||||
|
#
|
||||||
|
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
staticDevName = "armory0";
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ ../../lib/hardware-notes.nix ];
|
||||||
|
|
||||||
|
hardwareNotes =
|
||||||
|
[ { title = "USB Armory network interface support";
|
||||||
|
text =
|
||||||
|
'' - rename the Armory USB network interface
|
||||||
|
- set Armory inteface ip to 10.0.0.2/24
|
||||||
|
- enable NAT and forward Armory interface
|
||||||
|
- add the name 'armory' to /etc/hosts
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
services.udev.extraRules =
|
||||||
|
''SUBSYSTEM=="net", ACTION=="add", ATTRS{idVendor}=="0525", ATTRS{idProduct}=="a4a2", NAME="${staticDevName}"'';
|
||||||
|
# systemshit will probably still leave an a interface with a garbage name around
|
||||||
|
|
||||||
|
networking =
|
||||||
|
{ interfaces."${staticDevName}".ip4 = [{ address = "10.0.0.2"; prefixLength = 24; }];
|
||||||
|
nat = { enable = true; internalInterfaces = [ staticDevName ]; };
|
||||||
|
extraHosts = "10.0.0.1 armory";
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue