mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-11-10 09:43:30 +01:00
This adds automatic network configuration based on detected hardware: - networking/default.nix: Auto-configure DHCP on physical interfaces Detects Ethernet, WLAN, USB-Link, and generic network interfaces, automatically enabling DHCP on each. Excludes loopback and mainframe interfaces. Sets networking.useDHCP and per-interface useDHCP. - networking/intel.nix: Intel WiFi firmware detection Auto-enables firmware for Intel 2200BG and 3945ABG wireless cards based on PCI vendor/device IDs. - networking/initrd.nix: Network drivers in initrd Loads network controller drivers when boot.initrd.network.enable is set, enabling network boot scenarios. Builds on PR #454847 (boot & storage). Part of incremental upstreaming from nixos-facter-modules.
21 lines
665 B
Nix
21 lines
665 B
Nix
{ lib, config, ... }:
|
|
let
|
|
facterLib = import ../lib.nix lib;
|
|
|
|
inherit (config.hardware.facter) report;
|
|
in
|
|
{
|
|
options.hardware.facter.detected.boot.initrd.networking.kernelModules = lib.mkOption {
|
|
type = lib.types.listOf lib.types.str;
|
|
default = lib.uniqueStrings (facterLib.collectDrivers (report.hardware.network_controller or [ ]));
|
|
defaultText = "hardware dependent";
|
|
description = ''
|
|
List of kernel modules to include in the initrd to support networking.
|
|
'';
|
|
};
|
|
|
|
config = lib.mkIf config.boot.initrd.network.enable {
|
|
boot.initrd.kernelModules = config.hardware.facter.detected.boot.initrd.networking.kernelModules;
|
|
};
|
|
}
|