diff --git a/pkgs/development/interpreters/ngn-k/default.nix b/pkgs/development/interpreters/ngn-k/default.nix index f45429e5a730..d74fba0dacfb 100644 --- a/pkgs/development/interpreters/ngn-k/default.nix +++ b/pkgs/development/interpreters/ngn-k/default.nix @@ -3,12 +3,14 @@ , stdenvNoLibs , fetchFromGitea , runtimeShell -, doCheck ? stdenv.hostPlatform == stdenv.buildPlatform +, doCheck ? withLibc && stdenv.hostPlatform == stdenv.buildPlatform +, withLibc ? true }: let - # k itself is compiled with -ffreestanding, but tests require a libc - useStdenv = if doCheck then stdenv else stdenvNoLibs; + # k itself can be compiled with -ffreestanding, but tests require a libc; + # if we want to build k-libc we need a libc obviously + useStdenv = if withLibc || doCheck then stdenv else stdenvNoLibs; in useStdenv.mkDerivation { @@ -37,7 +39,10 @@ useStdenv.mkDerivation { ''; makeFlags = [ "-e" ]; - buildFlags = [ "k" "libk.so" ]; + buildFlags = [ + (if withLibc then "k-libc" else "k") + "libk.so" + ]; checkTarget = "t"; inherit doCheck;