diff --git a/tuxedo/pulse/14/gen3/README.md b/tuxedo/pulse/14/gen3/README.md index 959ab83..e419ae4 100644 --- a/tuxedo/pulse/14/gen3/README.md +++ b/tuxedo/pulse/14/gen3/README.md @@ -12,15 +12,4 @@ Gen3](https://www.tuxedocomputers.com/en/TUXEDO-Pulse-14-Gen3). With the Linux Kernel version `6.6.33` (NixOS 24.05) there are shutdown issues resulting in the battery not turning off completely. Apparently a newer Kernel (tested with `6.8.12`) fixes this (the exact version where this problem is fixed is unknown). - -You can use - -```nix - boot.kernelPackages = - if (config.boot.zfs.enabled) - then pkgs.zfs.latestCompatibleLinuxPackages - else pkgs.linuxPackages_latest; -``` - -to use the latest Kernel, where `pkgs` should probably -be the `nixos-unstable` channel (`github:nixos/nixpkgs/nixos-unstable`). +This `default.nix` will upgrade to the `pkgs.linuxPackages_latest` if the kernel is older than `6.8.12`. diff --git a/tuxedo/pulse/14/gen3/default.nix b/tuxedo/pulse/14/gen3/default.nix index f43fbb0..fb4aa24 100644 --- a/tuxedo/pulse/14/gen3/default.nix +++ b/tuxedo/pulse/14/gen3/default.nix @@ -1,4 +1,9 @@ -{pkgs, ...}: { +{ + lib, + pkgs, + config, + ... +}: { imports = [ ../../../../common/cpu/amd ../../../../common/cpu/amd/pstate.nix @@ -6,4 +11,14 @@ ../../../../common/pc/laptop ../../../../common/pc/laptop/ssd ]; + + # Fixing a power-issue with older kernels. + # When powered off, the battery does not turn off completely. + # Kernel 6.8.12 fixes this, + # the exact version is still unknown which fixed this. + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.8.12") ( + if (config.boot.zfs.enabled) + then pkgs.zfs.latestCompatibleLinuxPackages + else pkgs.linuxPackages_latest + ); }