From e7b03b977060954d4057b42bb64bbcb38fef3642 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Wed, 26 Apr 2023 12:54:38 +0200 Subject: [PATCH] dumpyourvms: core: use linuxPackages_6_1 and add check for kernel version for WiFi kernel module pre-sleep + post-sleep hook --- hosts/dumpyourvms/dumpyourvms.nix | 8 ++++++-- modules/core/boot.nix | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hosts/dumpyourvms/dumpyourvms.nix b/hosts/dumpyourvms/dumpyourvms.nix index c2b9cd29..3b1e4ab3 100644 --- a/hosts/dumpyourvms/dumpyourvms.nix +++ b/hosts/dumpyourvms/dumpyourvms.nix @@ -135,8 +135,12 @@ in { # brcmfmac being loaded during hibernation would inhibit a successful resume # https://bugzilla.kernel.org/show_bug.cgi?id=101681#c116. # Also brcmfmac could randomly crash on resume from sleep. - powerUpCommands = lib.mkBefore "${pkgs.kmod}/bin/modprobe brcmfmac_wcc brcmfmac"; - powerDownCommands = lib.mkBefore "${pkgs.kmod}/bin/rmmod brcmfmac_wcc brcmfmac"; + powerUpCommands = lib.mkBefore ("${pkgs.kmod}/bin/modprobe brcmfmac" + + lib.optionalString + (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.2") " brcmfmac_wcc"); + powerDownCommands = lib.mkBefore ("${pkgs.kmod}/bin/rmmod brcmfmac" + + lib.optionalString + (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.2") " brcmfmac_wcc"); }; # Change lid switch behaviour diff --git a/modules/core/boot.nix b/modules/core/boot.nix index 23eb40fd..a1764a3c 100644 --- a/modules/core/boot.nix +++ b/modules/core/boot.nix @@ -36,7 +36,7 @@ in { loader.systemd-boot.enable = lib.mkDefault true; # Use latest linux kernel by default - kernelPackages = lib.mkDefault pkgs.linuxPackages_6_2; + kernelPackages = lib.mkDefault pkgs.linuxPackages_6_1; # Support ntfs drives supportedFilesystems = ["ntfs"];