liminix/modules/hardware.nix

80 lines
2.5 KiB
Nix
Raw Normal View History

2023-08-09 23:27:37 +02:00
## Hardware-dependent options
## ==========================
##
## These are attributes of the hardware not of the application
## you want to run on it, and would usually be set in the "device" file:
## :file:`devices/manuf-model/default.nix`
{ lib, pkgs, config, ...}:
let
inherit (lib) mkEnableOption mkOption types isDerivation hasAttr ;
in {
options = {
boot = {
};
hardware = {
dts = {
2023-08-07 22:43:12 +02:00
src = mkOption {
type = types.path;
description = "Path to the device tree source (usually from OpenWrt)";
};
includes = mkOption {
default = [];
2023-08-07 22:43:12 +02:00
description = "List of directories to search for DTS includes (.dtsi files)";
type = types.listOf types.path;
};
};
defaultOutput = mkOption {
2023-08-07 22:43:12 +02:00
description = "\"Default\" output: what gets built for this device when outputs.default is requested. Typically this is \"flashimage\" or \"vmroot\"";
type = types.nonEmptyStr;
};
ram = {
startAddress = mkOption {
type = types.int;
};
};
flash = {
2023-03-07 23:03:31 +01:00
# start address and size of whichever partition (often
# called "firmware") we're going to overwrite with our
# kernel uimage and root fs. Not the entire flash, as
# that often also contains the bootloader, data for
# for wireless devices, etc
2023-08-07 22:43:12 +02:00
address = mkOption {
description = ''
Start address of whichever partition (often
called "firmware") we're going to overwrite with our
kernel uimage and root fs. Usually not the entire flash, as
we don't want to clobber the bootloader, calibration data etc
'';
type = types.str;
};
size = mkOption {
type = types.str;
description = "Size in bytes of the firmware partition";
};
eraseBlockSize = mkOption {
description = "Flash erase block size in bytes";
type = types.str;
};
};
2023-11-12 19:47:31 +01:00
loadAddress = mkOption { type = types.ints.unsigned; default = null; };
2023-11-12 19:50:47 +01:00
entryPoint = mkOption { type = types.ints.unsigned; };
radios = mkOption {
2023-08-07 22:43:12 +02:00
description = ''
Kernel modules (from mac80211 package) required for the
wireless devices on this board
'';
type = types.listOf types.str;
default = [];
example = ["ath9k" "ath10k"];
};
rootDevice = mkOption { };
networkInterfaces = mkOption {
type = types.attrsOf types.anything;
};
};
};
}