Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
6 of 28 tasks
Mic92 opened this issue Jun 20, 2024 · 8 comments
Open
6 of 28 tasks

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

Mic92 opened this issue Jun 20, 2024 · 8 comments

Comments

@Mic92
Copy link
Member

Mic92 commented Jun 20, 2024

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:

  • Do we upstream them as module options or as importable profiles?
@Mic92 Mic92 pinned this issue Jun 20, 2024
@SuperSandro2000
Copy link
Member

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
Copy link
Member Author

Mic92 commented Jun 20, 2024

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

@Lyndeno
Copy link
Contributor

Lyndeno commented Jun 24, 2024

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
Copy link
Contributor

Lyndeno commented Jun 25, 2024

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
Copy link
Member Author

Mic92 commented Jun 25, 2024

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

@Mic92
Copy link
Member Author

Mic92 commented Jun 25, 2024

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

Lyndeno added a commit to Lyndeno/nixos-hardware that referenced this issue Jul 1, 2024
mergify bot pushed a commit that referenced this issue Jul 9, 2024
@MattSturgeon
Copy link

MattSturgeon commented Jul 18, 2024

What's the migration path if I'm using some of the deprecated/removed modules?

Neither the warning or the issue description describe what I should do as an end-user 😉

The PR talks about upstreaming stuff, but I can't see any obvious recent changes in nixpkgs/nixos/hardware's history 🤔


For my case specifically:

I was using the common-cpu-intel-kaby-lake module, which was renamed to common-gpu-intel-kaby-lake without any deprecation warnings or aliases.
I just got an "attr doesn't exist" error after updating my lockfile, so I had to go hunting for recent changes.

The new name has a deprecation warning, but I can't work out what the alternative is supposed to be?

@Lyndeno
Copy link
Contributor

Lyndeno commented Jul 18, 2024

There is no alternative currently.

I plan to upstream some of this soon. Perhaps we should not have a deprecation warning until then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants