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

lenovo/yoga/7/pro-x: add 14IAH7; create shared for 14ARH7 and 14IAH7 #1284

Closed
wants to merge 1 commit into from

Conversation

sebaszv
Copy link
Contributor

@sebaszv sebaszv commented Dec 22, 2024

Description of changes

nixos-hardware already had Lenovo 14ARH7 (Lenovo Yoga Slim 7 Pro X) model
profiles. This an AMD device with an NVIDIA dedicated GPU. There is a profile
for integrated graphics only and another for hybrid graphics.

There is an Intel version of the same device, the Lenovo 14IAH7 (Lenovo Yoga
Slim 7i Pro X). Seeing as they are primarily the same device, save the
difference in processor under the Lenovo Yoga Slim 7 Pro X "line", the listed
was done to share values between the AMD version and the Intel version that was
added in this commit. It follows the same pattern of having a profile for
integrated graphics only and another for hybrid graphics.

The implementation for the 14ARH7 modules was changed during this, but the goals
were entirely maintained. There was a considerable amount of redundant rewriting
of values that were in imported modules. An effort to remove unnecessary
declarations in favour of importing common modules was done. "Optional" values
were assigned with lib.mkDefault as well, such as for
hardware.nvidia.nvidiaSettings. According to CONTRIBUTING.md, this is
encouraged.

The 14ARH7 nixosModule names were left as is to not cause unnecessary
breakages.

  • Create 'pro-x' subsection in lenovo/yoga/7
  • Pull content from '14ARH7' profiles to share with '14IAH7' in
    lenovo/yoga/7/pro-x/shared
  • Strip '14ARH7' profiles to use shared modules and only have unique values
  • Strip unnecessary declarations in favour of importing common modules
  • Create profiles for '14IAH7'
  • Update flake.nix and README.md
Things done
  • Tested the changes in your own NixOS Configuration
  • Tested the changes end-to-end by using your fork of nixos-hardware and
    importing it via <nixos-hardware> or Flake input

@sebaszv sebaszv force-pushed the lenovo_yoga_7_pro-x branch 9 times, most recently from 34bfbc3 to 6fbe324 Compare December 22, 2024 07:35
@sebaszv
Copy link
Contributor Author

sebaszv commented Dec 22, 2024

Should the deprecated profile lenovo-yoga-7-14ARH7 be removed now as well with this restructuring?

The commit that deprecated profile in master is 5 months old at this point:
5bd0371

@sebaszv sebaszv force-pushed the lenovo_yoga_7_pro-x branch 7 times, most recently from 56d7397 to 93ab659 Compare December 22, 2024 08:15
`nixos-hardware` already had Lenovo 14ARH7 (Lenovo Yoga Slim 7 Pro X)
model profiles. This an AMD device with an NVIDIA dedicated GPU.
There is a profile for integrated graphics only and another for hybrid
graphics.

There is an Intel version of the same device, the Lenovo 14IAH7
(Lenovo Yoga Slim 7i Pro X). Seeing as they are primarily the same
device, save the difference in processor under the Lenovo Yoga Slim 7
Pro X "line", the listed was done to share values between the AMD
version and the Intel version that was added in this commit. It
follows the same pattern of having a profile for integrated graphics
only and another for hybrid graphics.

The implementation for the 14ARH7 modules was changed during this, but
the goals were entirely maintained. There was a considerable amount of
redundant rewriting of values that were in imported modules. An effort
to remove unnecessary declarations in favour of importing common
modules was done. "Optional" values were assigned with `lib.mkDefault`
as well, such as for `hardware.nvidia.nvidiaSettings`. According to
`CONTRIBUTING.md`, this is encouraged.

The 14ARH7 `nixosModule` names were left as is to not cause
unnecessary breakages.

- Create 'pro-x' subsection in `lenovo/yoga/7`
- Pull content from '14ARH7' profiles to share with '14IAH7' in `lenovo/yoga/7/pro-x/shared`
- Strip '14ARH7' profiles to use shared modules and only have unique values
- Strip unnecessary declarations in favour of importing common modules
- Create profiles for '14IAH7'
- Update `flake.nix` and `README.md`
@sebaszv sebaszv force-pushed the lenovo_yoga_7_pro-x branch from 93ab659 to c7d419e Compare December 22, 2024 08:17
@sebaszv sebaszv closed this Dec 22, 2024
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

Successfully merging this pull request may close these issues.

1 participant