Skip to content

Commit

Permalink
p14s, t14s: fix linux-firmware version check
Browse files Browse the repository at this point in the history
nixpkgs is using the `unstable-` version currently

See NixOS/nixpkgs@beb6196
  • Loading branch information
dadada committed Jul 29, 2023
1 parent ba9650b commit 0b54e0c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion lenovo/thinkpad/p14s/amd/gen2/default.nix
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
Expand Down
9 changes: 6 additions & 3 deletions lenovo/thinkpad/t14s/amd/gen1/default.nix
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 0b54e0c

Please sign in to comment.