linux: don't compress by ZSTD on 32-bit

It doesn't build on i686 and I don't consider it worth deep
investigation.  I tried a VM test, too (nixosTests.knot).
This commit is contained in:
Vladimír Čunát 2021-04-03 10:46:30 +02:00
parent 7ed2b59f28
commit 7a3f21c1e4
No known key found for this signature in database
GPG key ID: E747DF1F9575A3AA

View file

@ -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