nixpkgs/pkgs/development/compilers/purescript/purescript/test-minimal-module/default.nix
zimbatm df1b67fdfd purescript.tests.minimal-module: use lib.sources.sourceByGlobs
Filter src to the .purs and .js files actually compiled, dropping
default.nix from the closure.
2026-05-26 21:53:50 +12:00

21 lines
423 B
Nix

{
lib,
runCommand,
purescript,
nodejs,
}:
runCommand "purescript-test-minimal-module" { } ''
${purescript}/bin/purs compile -o ./output ${
lib.sources.sourceByGlobs ./. [
"*.purs"
"*.js"
]
}/Main.purs
echo 'import {main} from "./output/Main/index.js"; main()' > node.mjs
${nodejs}/bin/node node.mjs | grep "hello world" || (echo "did not output hello world"; exit 1)
touch $out
''