From 5bd0371d3ff4c121b03450de8cfd643547b11fe1 Mon Sep 17 00:00:00 2001 From: mexisme Date: Tue, 23 Jul 2024 14:31:45 +1200 Subject: [PATCH] Create lenovo-yoga-7-14ARH7-amdgpu and lenovo-yoga-7-14ARH7-nvidia entries - Previous attr-set style providing "amdgpu" and "nvidia" is broken by PR #1046 - Add deprecation assertion for lenovo-yoga-7-14ARH7 --- flake.nix | 2 ++ lenovo/yoga/7/14ARH7/ATTR-SET-DEPRECATION.md | 16 ++++++++++++++++ lenovo/yoga/7/14ARH7/default.nix | 19 +++++++------------ 3 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 lenovo/yoga/7/14ARH7/ATTR-SET-DEPRECATION.md diff --git a/flake.nix b/flake.nix index caa4a71..64d4913 100644 --- a/flake.nix +++ b/flake.nix @@ -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; diff --git a/lenovo/yoga/7/14ARH7/ATTR-SET-DEPRECATION.md b/lenovo/yoga/7/14ARH7/ATTR-SET-DEPRECATION.md new file mode 100644 index 0000000..9ef5239 --- /dev/null +++ b/lenovo/yoga/7/14ARH7/ATTR-SET-DEPRECATION.md @@ -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) diff --git a/lenovo/yoga/7/14ARH7/default.nix b/lenovo/yoga/7/14ARH7/default.nix index 851033c..36605a1 100644 --- a/lenovo/yoga/7/14ARH7/default.nix +++ b/lenovo/yoga/7/14ARH7/default.nix @@ -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"; + } + ]; }