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.
This adds automatic kernel module detection for boot-critical hardware:
- disk.nix: Detects and loads kernel modules for storage controllers
Auto-detects modules for: disk controllers, storage controllers,
and FireWire controllers (for FireWire-attached disks).
Modules are automatically added to boot.initrd.availableKernelModules.
- keyboard.nix: Detects USB controller drivers for keyboard support
Ensures USB HID drivers are loaded in initrd for keyboard access
during boot (critical for LUKS password entry, etc.).
Follow up to #454237.
Part of incremental upstreaming from nixos-facter-modules.
This adds foundational functionality for nixos-facter hardware detection:
- lib.nix: Internal helper functions for querying facter reports
- hasCpu/hasAmdCpu/hasIntelCpu: CPU vendor detection
- collectDrivers: Extract driver_modules from hardware entries
- toZeroPaddedHex: Format USB device IDs (for fingerprint matching)
- system.nix: Auto-detect nixpkgs.hostPlatform from facter report
Automatically sets the correct platform (x86_64-linux, aarch64-linux, etc.)
based on the hardware report, reducing manual configuration.
This builds on the base infrastructure added in PR #450303 and provides
the foundation for upcoming hardware detection modules (boot, networking,
graphics, etc.).
Part of the incremental upstreaming effort from:
https://github.com/nix-community/nixos-facter-modules
This is the first step to upstream nixos-facter-modules into
nixpkgs/nixos:
https://github.com/numtide/nixos-facter-modules/
We tried to stick close to the semantics nixos-generate-config + some
extra features. We choose a new prefix for hardware.facter to live in so
that existing users of nixos-facter-modules can continue using it while
the upstreaming is in progress.
The reason for upstreaming is to make it easier to have nixos-facter as
choice for hardware detection as part of our normal NixOS installation workflow.
Hardware from my experience takes many hands since it is hard to test
without having access to a large variety of hardware.
We hope that with nixos-facter we can reduce the boiler code required in
the nixos-hardware project and provide better out-of-the-box support,
even if a model has not been explicitly added to nixos-hardware.
I.e. unlike ubuntu we don't have support for detecting required GPU
drivers. We believe that nixos-hardware will be still required for some
vendor specific quirks, but we could in future automatically select the
profiles based on reported SKU from facter.
For more details watch the 2024 NixCon talk: https://www.youtube.com/watch?v=3H3YUqibC6c
Typically services have a `package` option, so it can be set externally
if users are running the stable version but want the package from
unstable, or devs want to test a package from their flake in production.
Really useful in many situations!
Also, the previous implementation was using `pkgs.runCommand` which is
discouraged due to
[IFD](https://nix.dev/manual/nix/2.26/language/import-from-derivation)
(import from derivation) leading to potential slowdowns during
evaluation. I opted for reading the json file and using
[lib.attrsets.recursiveUpdate](https://ryantm.github.io/nixpkgs/functions/library/attrsets/#function-library-lib.attrsets.recursiveUpdate)
to update the default values with the user provided ones.
- fixes#426282
- current implementation breaks generation of strategies,
when strategies are not defined by user.
- minimal working config with `strategies.default = null`:
```nix
hardware.fw-fanctrl = {
enable = true;
config.strategies = { };
};
```
- User should be able to start the service, when only `hardware.fw-fanctrl.enable`
is enabled.
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:
nix-build ci -A fmt.check
This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).
This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).
Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).
If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
By enabling this module, the jlink system group is created and udev
rules from the libjaylink package are enabled. Read-/Write access is
granted to the members of the jlink group and to seat sessions.
Signed-off-by: Felix Singer <felixsinger@posteo.net>