Hello!
While i investigated how to add hardware support using some udev rules, i found the syntax hardware.bladeRF.enable
. It seems common, so i think that is how it should be done.
But enabling video drivers is different and quiet complex.
https://nixos.org/nixos/manual/#sec-x11-graphics-cards-nvidia
So could we just introduce this and use the full potential of NixOS as an expert system ?
hardware.gpu.nvidia.enable
hardware.gpu.amd.enable
hardware.gpu.ati.enable
hardware.gpu.intel.enable
For example, WHEN hardware.gpu.nvidia.enable = true;
AND nixpkgs.config.allowUnfree = true;
, the proprietary driver is used.
In addition, WHEN services.boinc.enable = true;
THEN services.boinc.extraEnvPackages = with pkgs; [ linuxPackages.nvidia_x11 ocl-icd ];
.
I tried that in my config: Add NVIDIA and AMD module · davidak/nixos-config@6a7c365 · GitHub
It should be possible for nixos-generate-config
to detect hardware like GPUs and set them as metadata in hardware-configuration.nix
. WHEN an NVIDIA GPU is detected, hardware.gpu.nvidia.enable
should be set to true. The correct driver version for the Model should get automatically detected.
Discussion about that:
opened 03:52AM - 06 Feb 20 UTC
Don't know if it's possible but there should be a way to do something like `<nix… os-hardware/auto-detect>` which would automatically include the right config for the device, which could enable including the right config in an automated fashion.
Otherwise a tool that just returns the right path or nothing if no hardware-quirk conf is needed would be cool
Needing this for scripting purposes
opened 02:36PM - 16 Jan 18 UTC
The files under `/sys/devices/virtual/dmi/id/` should allow most laptops, and pr… obably brand-name pre-built computers too.
This could probably be used to detect available hardware configuration in some way, and the values could be used to help categorize the files in a way that is automatically searchable. Some of that information ([modalias](http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html)) is used in the udev hwdb to detect hardware and apply quirks to them.
I have attached a dump of the data in different classes of machines I own. This will help kickstart discussion and discovery of the helpful attributes.
* * *
##### Acer C720p (with MrChromebox's coreboot-based UEFI)
```
~ $ (cd /sys/devices/virtual/dmi/id/ ; for f in *; do echo -n "$f="; cat "$f"; done)
bios_date=07/14/2017
bios_vendor=coreboot
bios_version=MrChromebox
board_name=Peppy
board_serial=cat: board_serial: Permission denied
board_vendor=GOOGLE
board_version=1.0
chassis_asset_tag=
chassis_serial=cat: chassis_serial: Permission denied
chassis_type=9
chassis_vendor=GOOGLE
chassis_version=
modalias=dmi:bvncoreboot:bvrMrChromebox:bd07/14/2017:svnGOOGLE:pnPeppy:pvr1.0:rvnGOOGLE:rnPeppy:rvr1.0:cvnGOOGLE:ct9:cvr:
power=cat: power: Is a directory
product_family=Google_Slippy
product_name=Peppy
product_serial=cat: product_serial: Permission denied
product_version=1.0
subsystem=cat: subsystem: Is a directory
sys_vendor=GOOGLE
uevent=MODALIAS=dmi:bvncoreboot:bvrMrChromebox:bd07/14/2017:svnGOOGLE:pnPeppy:pvr1.0:rvnGOOGLE:rnPeppy:rvr1.0:cvnGOOGLE:ct9:cvr:
```
##### ASUS TP300LA
```
~ $ (cd /sys/devices/virtual/dmi/id/ ; for f in *; do echo -n "$f="; cat "$f"; done)
bios_date=11/09/2015
bios_vendor=American Megatrends Inc.
bios_version=TP300LA.205
board_asset_tag=ATN12345678901234567
board_name=TP300LA
board_serial=cat: board_serial: Permission denied
board_vendor=ASUSTeK COMPUTER INC.
board_version=1.0
chassis_asset_tag=No Asset Tag
chassis_serial=cat: chassis_serial: Permission denied
chassis_type=10
chassis_vendor=ASUSTeK COMPUTER INC.
chassis_version=1.0
modalias=dmi:bvnAmericanMegatrendsInc.:bvrTP300LA.205:bd11/09/2015:svnASUSTeKCOMPUTERINC.:pnTP300LA:pvr1.0:rvnASUSTeKCOMPUTERINC.:rnTP300LA:rvr1.0:cvnASUSTeKCOMPUTERINC.:ct10:cvr1.0:
power=cat: power: Is a directory
product_family=TP
product_name=TP300LA
product_serial=cat: product_serial: Permission denied
product_uuid=cat: product_uuid: Permission denied
product_version=1.0
subsystem=cat: subsystem: Is a directory
sys_vendor=ASUSTeK COMPUTER INC.
uevent=MODALIAS=dmi:bvnAmericanMegatrendsInc.:bvrTP300LA.205:bd11/09/2015:svnASUSTeKCOMPUTERINC.:pnTP300LA:pvr1.0:rvnASUSTeKCOMPUTERINC.:rnTP300LA:rvr1.0:cvnASUSTeKCOMPUTERINC.:ct10:cvr1.0:
```
##### Chuwi Hi10 Pro (HQ64) (cheap atom-based tablet)
```
~ $ (cd /sys/devices/virtual/dmi/id/ ; for f in *; do echo -n "$f="; cat "$f"; done)
bios_date=11/10/2016
bios_vendor=American Megatrends Inc.
bios_version=5.11
board_asset_tag=Hampoo_reserve
board_name=Cherry Trail CR
board_serial=cat: board_serial: Permission denied
board_vendor=Hampoo
board_version=V103
chassis_asset_tag=Default string
chassis_serial=cat: chassis_serial: Permission denied
chassis_type=3
chassis_vendor=Default string
chassis_version=Default string
modalias=dmi:bvnAmericanMegatrendsInc.:bvr5.11:bd11/10/2016:svnCHUWIINNOVATIONANDTECHNOLOGY(SHENZHEN)CO.LTD:pnHi10protablet:pvrHampoo_reserve:rvnHampoo:rnCherryTrailCR:rvrV103:cvnDefaultstring:ct3:cvrDefaultstring:
power=cat: power: Is a directory
product_family=CherryTrail CR -- Hampoo
product_name=Hi10 pro tablet
product_serial=cat: product_serial: Permission denied
product_uuid=cat: product_uuid: Permission denied
product_version=Hampoo_reserve
subsystem=cat: subsystem: Is a directory
sys_vendor=CHUWI INNOVATION AND TECHNOLOGY(SHENZHEN)CO.LTD
uevent=MODALIAS=dmi:bvnAmericanMegatrendsInc.:bvr5.11:bd11/10/2016:svnCHUWIINNOVATIONANDTECHNOLOGY(SHENZHEN)CO.LTD:pnHi10protablet:pvrHampoo_reserve:rvnHampoo:rnCherryTrailCR:rvrV103:cvnDefaultstring:ct3:cvrDefaultstring:
```
##### Custom PC build using a P5N7A-VM motherboard
```
~ $ (cd /sys/devices/virtual/dmi/id/ ; for f in *; do echo -n "$f="; cat "$f"; done)
bios_date=04/29/2010
bios_vendor=American Megatrends Inc.
bios_version=0519
board_asset_tag=To Be Filled By O.E.M.
board_name=P5N7A-VM
board_serial=cat: board_serial: Permission denied
board_vendor=ASUSTeK Computer INC.
board_version=Rev 1.xx
chassis_asset_tag=Asset-1234567890
chassis_serial=cat: chassis_serial: Permission denied
chassis_type=3
chassis_vendor=Chassis Manufacture
chassis_version=Chassis Version
modalias=dmi:bvnAmericanMegatrendsInc.:bvr0519:bd04/29/2010:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKComputerINC.:rnP5N7A-VM:rvrRev1.xx:cvnChassisManufacture:ct3:cvrChassisVersion:
power=cat: power: Is a directory
product_family=To Be Filled By O.E.M.
product_name=System Product Name
product_serial=cat: product_serial: Permission denied
product_uuid=cat: product_uuid: Permission denied
product_version=System Version
subsystem=cat: subsystem: Is a directory
sys_vendor=System manufacturer
uevent=MODALIAS=dmi:bvnAmericanMegatrendsInc.:bvr0519:bd04/29/2010:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKComputerINC.:rnP5N7A-VM:rvrRev1.xx:cvnChassisManufacture:ct3:cvrChassisVersion:
```
##### HP Z420 Workstation
```
~ $ (cd /sys/devices/virtual/dmi/id/ ; for f in *; do echo -n "$f="; cat "$f"; done)
bios_date=06/01/2016
bios_vendor=Hewlett-Packard
bios_version=J61 v03.90
board_asset_tag=DUFFMAN
board_name=1589
board_serial=cat: board_serial: Permission denied
board_vendor=Hewlett-Packard
board_version=0.00
chassis_asset_tag=DUFFMAN
chassis_serial=cat: chassis_serial: Permission denied
chassis_type=6
chassis_vendor=Hewlett-Packard
chassis_version=
modalias=dmi:bvnHewlett-Packard:bvrJ61v03.90:bd06/01/2016:svnHewlett-Packard:pnHPZ420Workstation:pvr:rvnHewlett-Packard:rn1589:rvr0.00:cvnHewlett-Packard:ct6:cvr:
power=cat: power: Is a directory
product_family=103C_53335X G=D
product_name=HP Z420 Workstation
product_serial=cat: product_serial: Permission denied
product_uuid=cat: product_uuid: Permission denied
product_version=
subsystem=cat: subsystem: Is a directory
sys_vendor=Hewlett-Packard
uevent=MODALIAS=dmi:bvnHewlett-Packard:bvrJ61v03.90:bd06/01/2016:svnHewlett-Packard:pnHPZ420Workstation:pvr:rvnHewlett-Packard:rn1589:rvr0.00:cvnHewlett-Packard:ct6:cvr:
```
The syntax is already used in hardware.cpu.intel.updateMicrocode
, but not for GPUs.
What do you think?