NixOS / nixos-hardware

A collection of NixOS modules covering hardware quirks.
Creative Commons Zero v1.0 Universal
1.72k stars 543 forks source link

Let's upstream all profiles in `common/` to nixos #992

Open Mic92 opened 1 week ago

Mic92 commented 1 week ago

Having generic hardware modules profiles available allows us to include them automatically in tools like nixos-generate-config and co.

Hence I am proposing to upstream all our modules in common and remove them from this repository:

Open questions:

SuperSandro2000 commented 1 week ago

I want to throw the following snippet from nixos-modules into the ring, too.

    hardware.opengl = {
      extraPackages = with pkgs; [
        intel-compute-runtime # OpenCL library for iGPU
        # video encoding/decoding hardware acceleration
        intel-media-driver # broadwell or newer
        intel-vaapi-driver # older hardware like haswell
      ];
      extraPackages32 = with pkgs.pkgsi686Linux; [
        # video encoding/decoding hardware acceleration
        intel-media-driver # broadwell or newer
        intel-vaapi-driver # older hardware like haswell
      ];
    };

I think we should not upstream them as is, otherwise we have 20+ new modules which only contain minimal things. We should probably combine them into a general intel module where we have some options for CPU/GPU/etc.

Mic92 commented 1 week ago

We should be soon able to drop the amdgpu module from nixos-hardware after https://nixpk.gs/pr-tracker.html?pr=319865 landed.

Lyndeno commented 4 days ago

I like the idea of configurable modules. Then we can have generic cpu/gpu modules where we can specify say, "kaby lake" or "rdna2", etc.

Lyndeno commented 4 days ago

Something along the idea of:

hardware.graphics.family = "rdna2";
hardware.processor.family = "zen3";
hardware.graphics.opencl.enable = true;
hardware.processor.enableMicrocode = true;

Then have the modules enable the proper settings: opencl packages, vaapi, thermald, patches, microcode (if unsupported in tree, perhaps for apple m series?) all configured for the given hardware families.

Since it is possible to have multiple GPUs, perhaps the graphics.family setting could take a list of families, and ensure setup for each.

Mic92 commented 4 days ago

We should have at least a vendor for both gpu and cpus, to avoid collision names between family names.

Mic92 commented 4 days ago

We want to provide the needed information with this project: https://github.com/numtide/nixos-facter