writeShellApplication: fix shellcheck availability check

This fixes NixOS evaluation for native riscv64-linux
This commit is contained in:
misuzu
2024-12-07 23:04:58 +02:00
parent d0797a04b8
commit 83e3724538
@@ -299,7 +299,7 @@ rec {
# GHC (=> shellcheck) isn't supported on some platforms (such as risc-v)
# but we still want to use writeShellApplication on those platforms
let
shellcheckSupported = lib.meta.availableOn stdenv.buildPlatform shellcheck-minimal.compiler;
shellcheckSupported = lib.meta.availableOn stdenv.buildPlatform shellcheck-minimal.compiler && (builtins.tryEval shellcheck-minimal.compiler.outPath).success;
excludeFlags = lib.optionals (excludeShellChecks != [ ]) [ "--exclude" (lib.concatStringsSep "," excludeShellChecks) ];
shellcheckCommand = lib.optionalString shellcheckSupported ''
# use shellcheck which does not include docs