mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
Filter src to the .purs and .js files actually compiled, dropping default.nix from the closure.
21 lines
423 B
Nix
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
|
|
''
|