diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix index c90dbd73f2f..777a91241bb 100644 --- a/pkgs/os-specific/linux/kernel/common-config.nix +++ b/pkgs/os-specific/linux/kernel/common-config.nix @@ -680,7 +680,14 @@ let DEBUG_MEMORY_INIT = option yes; }); - misc = { + misc = let + # Use zstd for kernel compression if 64-bit and newer than 5.9, otherwise xz. + # i686 issues: https://github.com/NixOS/nixpkgs/pull/117961#issuecomment-812106375 + useZstd = stdenv.buildPlatform.is64bit && versionAtLeast version "5.9"; + in { + KERNEL_XZ = mkIf (!useZstd) yes; + KERNEL_ZSTD = mkIf useZstd yes; + HID_BATTERY_STRENGTH = yes; # enabled by default in x86_64 but not arm64, so we do that here HIDRAW = yes; @@ -696,10 +703,6 @@ let MODULE_COMPRESS = yes; MODULE_COMPRESS_XZ = yes; - # use zstd for kernel compression if newer than 5.9, else xz. - KERNEL_XZ = whenOlder "5.9" yes; - KERNEL_ZSTD = whenAtLeast "5.9" yes; - SYSVIPC = yes; # System-V IPC AIO = yes; # POSIX asynchronous I/O