To be able to do such, it was required to add the vendor directory to the git project.
38 lines
1.0 KiB
Nix
38 lines
1.0 KiB
Nix
{
|
|
description = "A very basic flake";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils, }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
test-command = ''deno test --unstable --allow-read=tests .'';
|
|
test = pkgs.stdenv.mkDerivation {
|
|
name = "test";
|
|
src = ./.;
|
|
buildInputs = [pkgs.deno];
|
|
buildPhase = ''
|
|
export DENO_DIR=`$tmp`
|
|
deno test --import-map vendor/import_map.json --unstable --allow-read=tests . > test_results.txt
|
|
'';
|
|
installPhase = ''
|
|
mv test_results.txt $out
|
|
'';
|
|
|
|
|
|
};
|
|
in {
|
|
packages = {
|
|
test = test;
|
|
};
|
|
devShells.default = pkgs.mkShell {
|
|
buildInputs = with pkgs; [deno
|
|
psrecord];
|
|
};
|
|
});
|
|
}
|