Commit graph

715 commits

Author SHA1 Message Date
Jörg Thalheim 6741751801 nixos/facter: add networking configuration
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.
2025-10-24 12:50:34 +02:00
Jörg Thalheim cb883c36e3 nixos/facter: add boot and storage detection
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.
2025-10-23 12:47:17 +02:00
Jörg Thalheim 368ed53d31
nixos/facter: add core library and system detection (#454237) 2025-10-23 10:41:20 +00:00
kruziikrel13 5cd26d1051 nixos/qmk: add keychron support 2025-10-23 16:48:31 +10:00
Jörg Thalheim ab49e37a02 nixos/facter: add core library and system detection
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
2025-10-22 12:38:46 +02:00
Lukas Wurzinger 1f4c50ab81
lib/cli: deprecate toGNUCommandLine 2025-10-21 21:01:38 +02:00
Jörg Thalheim 5965426331
nixos/facter: add initial commit (#450303) 2025-10-14 09:38:25 +00:00
Jörg Thalheim b7f40d25eb nixos/facter: add initial commit
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
2025-10-14 10:32:18 +01:00
Ramses f28af50384
udev rules for tuxedo drivers (#444087) 2025-10-13 19:39:12 +00:00
Tristan Ross 94451f7fdc nixos/tenstorrent: use tt-smi from by-name 2025-10-12 10:00:29 -07:00
Tristan Ross 954d1e2a01
nixos/tenstorrent: add tt-smi 2025-10-10 21:45:11 -07:00
Tristan Ross ab3e01f167
nixos/tenstorrent: add tt-system-tools 2025-10-10 21:39:15 -07:00
Tristan Ross 52d2e894fd
nixos/tenstorrent: add meta.maintainers 2025-10-10 21:39:12 -07:00
Tristan Ross 47348f554e nixos/tenstorrent: init 2025-10-10 19:23:45 -07:00
Wolfgang Walther 91a8fee3aa
treewide: remove redundant parentheses
Auto-fixed by nixf-diagnose.
2025-10-05 10:52:03 +02:00
Thiago Kenji Okada 7491fd75b5
nixos/opentabletdriver: refactor (#423612) 2025-09-30 08:34:11 +00:00
Benjamin Staffin dad7e8f474
nixos/hddfancontrol: loosen pwmPaths and disks types to str, nixos/hddtemp: allow command substitution for drives (#421862) 2025-09-28 15:24:20 +00:00
Dominik Xaver Hörl e1c11f9d3d nixos/tuxedo-drivers: use udev rules from tuxedo-drivers package 2025-09-19 04:56:32 +02:00
Johannes Kirschbauer a593032e93
nixos/modules: fw-fanctrl use correct type in freeformType 2025-09-05 18:04:13 +02:00
dish 970dcca69c
treewide: Fix links in module documentation 2025-08-25 12:55:11 -04:00
John Titor 35ca84f922 nixos/cpu/amd: allow overriding microcode pkg 2025-08-18 11:28:07 +05:30
Mirza Arnaut 15ad26705b nixos/hardware.fw-fanctrl: add package option and refactor using lib.attrsets.recursiveUpdate
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.
2025-07-27 19:12:59 +02:00
lassulus 04009c667d
fw-fanctrl: set default strategies (#426756) 2025-07-25 07:54:28 +02:00
Wolfgang Walther 5a0711127c
treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
0x4A6F bb46a07699
fw-fanctrl: set default strategies
- 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.
2025-07-23 20:42:01 +02:00
Jörg Thalheim 6cae24f7ec
nixos/iio: add package option (#425730) 2025-07-21 20:41:53 +02:00
Matthew Croughan ca573e60c6
sheep_net: init (#423744) 2025-07-16 17:06:11 +01:00
matthewcroughan c58a266a1e sheep_net: init
Co-authored-by: bloxx12 <charlie@charlieroot.dev>
Co-authored-by: Alyssa Ross <hi@alyssa.is>
2025-07-16 14:24:36 +01:00
Jörg Thalheim 8489ccc731 nixos/iio: add package option
this helps with overriding the iio package in situations where overlays
are ignored i.e. when the nixpkgs.pkgs option is used for performance.

In particular we want this for
https://github.com/FrameworkComputer/linux-docs/blob/main/framework12/nixOS.md#framework-12-nixos-tweaks
2025-07-16 11:19:08 +02:00
matthewcroughan 9783bde2f4 nixos/sheep-net: init 2025-07-15 19:16:41 +01:00
matthewcroughan dba9b2cb9c nixos/kryoflux: fix typo programs.kryoflux -> hardware.kryoflux 2025-07-15 19:05:57 +01:00
Matthew Croughan ab7ac10545
kryoflux: init at 3.50 (#423548) 2025-07-15 19:00:08 +01:00
matthewcroughan 24f92176fb nixos/kryoflux: init 2025-07-14 22:26:58 +01:00
Svenum cfe95170f1 nixos/fw-fanctrl: init 2025-07-13 18:22:47 +02:00
Heitor Augusto 5970f4d537
nixos/opentabletdriver: refactor 2025-07-08 17:59:15 -03:00
Philip Wilk 916b3f3bbe
nixos/hddtemp: allow use of command substitutions in drives option 2025-07-03 17:16:50 +01:00
Connor Baker 7d02b73d0a
nixos/hardware/nvidia: add prime.offload.offloadCmdMainProgram (#407588) 2025-06-09 15:20:49 -07:00
Masum Reza c9f192da92
nixos/amdgpu: add overdrive and ppfeaturemask option (#411155)
- `programs.corectrl.gpuOverclock.enable` -> `hardware.amdgpu.overdrive.enable`
- `programs.corectrl.gpuOverclock.ppfeaturemask` -> `hardware.amdgpu.overdrive.ppfeaturemask`
- `programs.tuxclocker.enableAMD` -> `hardware.amdgpu.overdrive.enable`
2025-05-27 19:45:13 +05:30
Peder Bergebakken Sundt 340cd4a445 nixos/hardware/nvidia: add prime.offload.offloadCmdMainProgram
prime-run is the default name on arch linux. This allows me and some others I found on github to slim their config.
2025-05-16 12:57:10 +02:00
Seth Flynn 8e551be5f1
nixos/graphics: don't mark package options as internal 2025-05-10 14:36:08 -04:00
Cryolitia PukNgae ef059726f1
nixos/xone: enable xpad-noone by default
Co-authored-by: misuzu <neironyan@gmail.com>
2025-04-29 22:38:48 +08:00
Gaetan Lepage 419e4d1822 nixos/hardware/nvidia: eager load nvidia-uvm for open driver
Fixes contingent CUDA issues with open driver:
https://github.com/NixOS/nixpkgs/issues/334180

Co-authored-by: Someone Serge <else@someonex.net>
2025-04-18 01:23:26 +02:00
Silvan Mosberger 374e6bcc40 treewide: Format all Nix files
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.
2025-04-01 20:10:43 +02:00
Nick Cao c58cb4c034
Update Nvidia busid check (#388892) 2025-03-26 18:33:41 -04:00
misuzu f630533b4a
nixos/xpad-noone: init (#389752) 2025-03-25 11:29:52 +02:00
Cryolitia PukNgae c33e419dd1
nixos/xpad-noone: init 2025-03-17 03:44:58 +08:00
Pol Dellaiera b29c5b7119
treewide: add documentation for nixos systemd units (#389283) 2025-03-15 21:30:08 +01:00
K900 656e50abce
mesa: more cleanups (#387292) 2025-03-13 16:55:54 +03:00
Felix Singer 4d8d5f5782 nixos/libjaylink: init module
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>
2025-03-12 18:42:28 +01:00
h7x4 ab0564bd10
treewide: add documentation for nixos systemd units 2025-03-12 18:00:38 +01:00