Skip to content

Commit

Permalink
Create lenovo-yoga-7-14ARH7-amdgpu and lenovo-yoga-7-14ARH7-nvidia en…
Browse files Browse the repository at this point in the history
…tries

- Previous attr-set style providing "amdgpu" and "nvidia" is broken by PR NixOS#1046
- Add deprecation assertion for lenovo-yoga-7-14ARH7
  • Loading branch information
mexisme authored and mergify[bot] committed Jul 25, 2024
1 parent 0550809 commit 5bd0371
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@
lenovo-thinkpad-z13-gen2 = import ./lenovo/thinkpad/z/gen2/z13;
lenovo-yoga-6-13ALC6 = import ./lenovo/yoga/6/13ALC6;
lenovo-yoga-7-14ARH7 = import ./lenovo/yoga/7/14ARH7;
lenovo-yoga-7-14ARH7-amdgpu = import ./lenovo/yoga/7/14ARH7/amdgpu;
lenovo-yoga-7-14ARH7-nvidia = import ./lenovo/yoga/7/14ARH7/nvidia;
lenovo-yoga-7-slim-gen8 = import ./lenovo/yoga/7/slim/gen8;
letsnote-cf-lx4 = import ./panasonic/letsnote/cf-lx4;
microchip-icicle-kit = import ./microchip/icicle-kit;
Expand Down
16 changes: 16 additions & 0 deletions lenovo/yoga/7/14ARH7/ATTR-SET-DEPRECATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Deprecation of //lenovo/yoga/7/14ARH7/default.nix

Background:
The `lenovo-yoga-7-14ARH7` provides an attr-set with `amdgpu` and `nvidia` entries, to allow users
to choose whether to enable only the AMD-GPU driver, or also enable the NVidia driver with (by
default) Prime enabled.

However, this attr-set style seems to be broken by [PR #1046](https://github.com/NixOS/nixos-hardware/pull/1046),
which exports modules as paths, instead.
That change seems to cause an error of "value is a path while a set was expected".

[PR #1053](https://github.com/NixOS/nixos-hardware/pull/1053):
- Replaced `lenovo-yoga-7-14ARH7.amdgpu` with a `lenovo-yoga-7-14ARH7-amdgpu` entry.
- Replaced `lenovo-yoga-7-14ARH7.nvidia` with a `lenovo-yoga-7-14ARH7-nvidia` entry.
- Made `lenovo-yoga-7-14ARH7` throw a deprecation error.
- [FIXES: #1052](https://github.com/NixOS/nixos-hardware/issues/1052)
19 changes: 7 additions & 12 deletions lenovo/yoga/7/14ARH7/default.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# When using from a Flake, you can access these via imports of the attr key, e.g:
#
# imports = [
# nixos-hardware.nixosModules.lenovo-yoga-7-14ARH7.amdgpu
# ];
#
## or:
# imports = [
# nixos-hardware.nixosModules.lenovo-yoga-7-14ARH7.nvidia
# ];
{ ... }:

{
amdgpu = import ./amdgpu;
nvidia = import ./nvidia;
assertions = [
{
assertion = false;
message = "Importing lenovo/yoga/7/14ARH7/ (default.nix) directly is deprecated! See https://github.com/NixOS/nixos-hardware/blob/master/lenovo/yoga/7/14ARH7/ATTR-SET-DEPRECATION.md for more details";
}
];
}

0 comments on commit 5bd0371

Please sign in to comment.