Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 buildPackages, 4 stdenv, 5 mkMesonExecutable, 6 7 nix-flake, 8 nix-flake-c, 9 nix-expr-test-support, 10 11 rapidcheck, 12 gtest, 13 runCommand, 14 15 # Configuration Options 16 17 version, 18 resolvePath, 19}: 20 21mkMesonExecutable (finalAttrs: { 22 pname = "nix-flake-tests"; 23 inherit version; 24 25 workDir = ./.; 26 27 buildInputs = [ 28 nix-flake 29 nix-flake-c 30 nix-expr-test-support 31 rapidcheck 32 gtest 33 ]; 34 35 mesonFlags = [ 36 ]; 37 38 passthru = { 39 tests = { 40 run = 41 runCommand "${finalAttrs.pname}-run" 42 { 43 meta.broken = !stdenv.hostPlatform.emulatorAvailable buildPackages; 44 } 45 ( 46 lib.optionalString stdenv.hostPlatform.isWindows '' 47 export HOME="$PWD/home-dir" 48 mkdir -p "$HOME" 49 '' 50 + '' 51 export _NIX_TEST_UNIT_DATA=${resolvePath ./data} 52 export NIX_CONFIG="extra-experimental-features = flakes" 53 ${stdenv.hostPlatform.emulator buildPackages} ${lib.getExe finalAttrs.finalPackage} 54 touch $out 55 '' 56 ); 57 }; 58 }; 59 60 meta = { 61 platforms = lib.platforms.unix ++ lib.platforms.windows; 62 mainProgram = finalAttrs.pname + stdenv.hostPlatform.extensions.executable; 63 }; 64 65})