From 0b54e0c3a2de839e55d563012f9dd79884006594 Mon Sep 17 00:00:00 2001 From: dadada Date: Sat, 29 Jul 2023 18:36:29 +0200 Subject: [PATCH] p14s, t14s: fix linux-firmware version check nixpkgs is using the `unstable-` version currently See https://github.com/NixOS/nixpkgs/commit/beb6196e9ed1f59fa9c8884b2b9e2d0eafb67bbc --- lenovo/thinkpad/p14s/amd/gen2/default.nix | 6 +++++- lenovo/thinkpad/t14s/amd/gen1/default.nix | 9 ++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lenovo/thinkpad/p14s/amd/gen2/default.nix b/lenovo/thinkpad/p14s/amd/gen2/default.nix index 4fefc37d4..60e9e4d3d 100644 --- a/lenovo/thinkpad/p14s/amd/gen2/default.nix +++ b/lenovo/thinkpad/p14s/amd/gen2/default.nix @@ -1,4 +1,8 @@ { lib, pkgs, config, ... }: +let + fwVersion = pkgs.linux-firmware.version; + oldLinuxFirmware = if (lib.hasPrefix "unstable" fwVersion) then (lib.versionOlder fwVersion "unstable-2023-02-10") else (lib.versionOlder fwVersion "20230210"); +in { imports = [ ../../../../../common/pc/laptop/acpi_call.nix @@ -12,7 +16,7 @@ # Wifi support - hardware.firmware = lib.mkIf (lib.versionOlder pkgs.linux-firmware.version "20230210") [ pkgs.rtw89-firmware ]; + hardware.firmware = lib.mkIf oldLinuxFirmware [ pkgs.rtw89-firmware ]; # For mainline support of rtw89 wireless networking boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.16") pkgs.linuxPackages_latest; diff --git a/lenovo/thinkpad/t14s/amd/gen1/default.nix b/lenovo/thinkpad/t14s/amd/gen1/default.nix index f6bb75aff..15c03effb 100644 --- a/lenovo/thinkpad/t14s/amd/gen1/default.nix +++ b/lenovo/thinkpad/t14s/amd/gen1/default.nix @@ -1,12 +1,15 @@ - { lib, pkgs, ... }: - +let + fwVersion = pkgs.linux-firmware.version; + oldLinuxFirmware = if (lib.hasPrefix "unstable" fwVersion) then (lib.versionOlder fwVersion "unstable-2023-02-10") else (lib.versionOlder fwVersion "20230210"); +in { imports = [ ../. ]; + # Wifi support - hardware.firmware = lib.mkIf (lib.versionOlder pkgs.linux-firmware.version "20230210") [ pkgs.rtw89-firmware ]; + hardware.firmware = lib.mkIf oldLinuxFirmware [ pkgs.rtw89-firmware ]; # For mainline support of rtw89 wireless networking boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.16") pkgs.linuxPackages_latest;