mirror of
				https://github.com/NixOS/nixos-hardware.git
				synced 2025-11-04 17:27:14 +08:00 
			
		
		
		
	inversepath/usbarmory: fix evaluation
This commit is contained in:
		@@ -1,34 +1,19 @@
 | 
			
		||||
#
 | 
			
		||||
# Module for hosting the USB Armory
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
{ ... }:
 | 
			
		||||
 | 
			
		||||
let
 | 
			
		||||
  staticDevName = "armory0";
 | 
			
		||||
in
 | 
			
		||||
{ dev ? "armory0" }:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  imports = [ ../../lib/hardware-notes.nix ];
 | 
			
		||||
  services.udev.extraRules = ''
 | 
			
		||||
    SUBSYSTEM=="net", ACTION=="add", ATTRS{idVendor}=="0525", ATTRS{idProduct}=="a4a2", NAME="${staticDevName}"
 | 
			
		||||
  '';
 | 
			
		||||
 | 
			
		||||
  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}"'';
 | 
			
		||||
 | 
			
		||||
  networking =
 | 
			
		||||
    { interfaces."${staticDevName}".ip4 = [{ address = "10.0.0.2"; prefixLength = 24; }];
 | 
			
		||||
      nat = { enable = true; internalInterfaces = [ staticDevName ]; };
 | 
			
		||||
      extraHosts = "10.0.0.1 armory";
 | 
			
		||||
  networking = {
 | 
			
		||||
    interfaces."${staticDevName}".ip4 = [{
 | 
			
		||||
      address = "10.0.0.2";
 | 
			
		||||
      prefixLength = 24;
 | 
			
		||||
    }];
 | 
			
		||||
    nat = {
 | 
			
		||||
      enable = true;
 | 
			
		||||
      internalInterfaces = [ dev ];
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    extraHosts = "10.0.0.1 armory";
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user