diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000000..b2be92b7db0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result diff --git a/infra/nom/default.nix b/infra/nom/default.nix new file mode 100644 index 00000000000..e7b4d4cdc71 --- /dev/null +++ b/infra/nom/default.nix @@ -0,0 +1,37 @@ +with import {}; + +let + mkRakuPackage = { name + , version + , src + , buildInputs ? [] + , nativeBuildInputs ? [] + }: stdenv.mkDerivation { + pname = name; + + inherit src version; + + nativeBuildInputs = [ pkgs.makeWrapper ] ++ nativeBuildInputs; + buildInputs = with pkgs; [ rakudo ] ++ buildInputs; + + # Raku programs are just-in-time compiled + dontBuild = true; + + installPhase = '' + mkdir -p $out + + cp -r bin/ $out/ + for bin in $out/bin/*; do + wrapProgram $bin --set RAKULIB $out/lib + done + + cp -r lib/ $out/ + ''; + }; +in + +mkRakuPackage { + name = "nom"; + version = "0.1.0"; + src = ./.; +} diff --git a/infra/nom/lib/Test.rakumod b/infra/nom/lib/Test.rakumod new file mode 100644 index 00000000000..b78237a8c43 --- /dev/null +++ b/infra/nom/lib/Test.rakumod @@ -0,0 +1,6 @@ +unit module Test; + +our sub hello () is export { + say 'Calling a test function'; +} +