{ stdenv, clang, wasilibc }: stdenv.mkDerivation { name = "triangle"; src = ./.; nativeBuildInputs = [ clang wasilibc ]; configurePhase = ""; buildPhase = '' clang \ --target=wasm32-unknown-wasi \ -O3 \ -flto \ -nostdlib \ -Wl,--no-entry \ -Wl,--export-all \ -Wl,--lto-O3 \ -o triangle.wasm \ triangle.c ''; checkPhase = ""; installPhase = '' mkdir -p $out ls -al mv triangle.js triangle.wasm $out ''; }