hardware.nix (2205B)
1 { lib, pkgs, config, ...}: 2 let 3 inherit (lib) mkEnableOption mkOption types isDerivation hasAttr ; 4 in { 5 options = { 6 boot = { 7 }; 8 hardware = { 9 dts = { 10 src = mkOption { 11 type = types.path; 12 description = "Path to the device tree source (usually from OpenWrt)"; 13 }; 14 includes = mkOption { 15 default = []; 16 description = "List of directories to search for DTS includes (.dtsi files)"; 17 type = types.listOf types.path; 18 }; 19 }; 20 defaultOutput = mkOption { 21 description = "\"Default\" output: what gets built for this device when outputs.default is requested. Typically this is \"flashimage\" or \"vmroot\""; 22 type = types.nonEmptyStr; 23 }; 24 flash = { 25 # start address and size of whichever partition (often 26 # called "firmware") we're going to overwrite with our 27 # kernel uimage and root fs. Not the entire flash, as 28 # that often also contains the bootloader, data for 29 # for wireless devices, etc 30 address = mkOption { 31 description = '' 32 Start address of whichever partition (often 33 called "firmware") we're going to overwrite with our 34 kernel uimage and root fs. Usually not the entire flash, as 35 we don't want to clobber the bootloader, calibration data etc 36 ''; 37 type = types.str; 38 }; 39 size = mkOption { 40 type = types.str; 41 description = "Size in bytes of the firmware partition"; 42 }; 43 eraseBlockSize = mkOption { 44 description = "Flash erase block size in bytes"; 45 type = types.str; 46 }; 47 }; 48 loadAddress = mkOption { default = null; }; 49 entryPoint = mkOption { }; 50 radios = mkOption { 51 description = '' 52 Kernel modules (from mac80211 package) required for the 53 wireless devices on this board 54 ''; 55 type = types.listOf types.str; 56 default = []; 57 example = ["ath9k" "ath10k"]; 58 }; 59 rootDevice = mkOption { }; 60 networkInterfaces = mkOption { 61 type = types.attrsOf types.anything; 62 }; 63 }; 64 }; 65 }