···357 '';
358359 checkPhase =
0000000000360 if checkPhase == null then ''
361 runHook preCheck
362 ${stdenv.shellDryRun} "$target"
363- # use shellcheck which does not include docs
364- # pandoc takes long to build and documentation isn't needed for in nixpkgs usage
365- ${lib.getExe (haskell.lib.compose.justStaticExecutables shellcheck.unwrapped)} "$target"
366 runHook postCheck
367 ''
368 else checkPhase;
···357 '';
358359 checkPhase =
360+ # GHC (=> shellcheck) isn't supported on some platforms (such as risc-v)
361+ # but we still want to use writeShellApplication on those platforms
362+ let
363+ shellcheckSupported = lib.meta.availableOn stdenv.buildPlatform shellcheck.compiler;
364+ shellcheckCommand = lib.optionalString shellcheckSupported ''
365+ # use shellcheck which does not include docs
366+ # pandoc takes long to build and documentation isn't needed for just running the cli
367+ ${lib.getExe (haskell.lib.compose.justStaticExecutables shellcheck.unwrapped)} "$target"
368+ '';
369+ in
370 if checkPhase == null then ''
371 runHook preCheck
372 ${stdenv.shellDryRun} "$target"
373+ ${shellcheckCommand}
00374 runHook postCheck
375 ''
376 else checkPhase;
···10351036 # Fresh toolchains frequently break -Werror build for minor issues.
1037 WERROR = whenAtLeast "5.15" no;
00001038 } // optionalAttrs (stdenv.hostPlatform.system == "x86_64-linux" || stdenv.hostPlatform.system == "aarch64-linux") {
1039 # Enable CPU/memory hotplug support
1040 # Allows you to dynamically add & remove CPUs/memory to a VM client running NixOS without requiring a reboot
···10351036 # Fresh toolchains frequently break -Werror build for minor issues.
1037 WERROR = whenAtLeast "5.15" no;
1038+1039+ # > CONFIG_KUNIT should not be enabled in a production environment. Enabling KUnit disables Kernel Address-Space Layout Randomization (KASLR), and tests may affect the state of the kernel in ways not suitable for production.
1040+ # https://www.kernel.org/doc/html/latest/dev-tools/kunit/start.html
1041+ KUNIT = no;
1042 } // optionalAttrs (stdenv.hostPlatform.system == "x86_64-linux" || stdenv.hostPlatform.system == "aarch64-linux") {
1043 # Enable CPU/memory hotplug support
1044 # Allows you to dynamically add & remove CPUs/memory to a VM client running NixOS without requiring a reboot