git.delta.rocks / jrsonnet / refs/commits / bfcd43bbf560

difftreelog

source

nix/jrsonnet.nix1.1 KiBsourcehistory
1{2  lib,3  rustPlatform,4  runCommand,5  makeWrapper,6  withNightlyFeatures ? false,7  forBenchmarks ? false,8}:9with lib; let10  filteredSrc = builtins.path {11    name = "jrsonnet-src-filtered";12    filter = path: type: !(builtins.baseNameOf path == "flake.nix" || builtins.baseNameOf path == "nix");13    path = ../.;14  };1516  # for some reason, filteredSrc hash still depends on nix directory contents17  # Moving it into a CA store drops leftover references18  src =19    runCommand "jrsonnet-src"20    {21      __contentAddressed = true;22    } "cp -r '${filteredSrc}' $out";23in24  rustPlatform.buildRustPackage rec {25    inherit src;26    pname = "jrsonnet";27    version = "current${optionalString withNightlyFeatures "-nightly"}";2829    cargoTestFlags = [30      "--features=mimalloc,legacy-this-file${optionalString withNightlyFeatures ",nightly"}"31    ];32    cargoBuildFlags = cargoTestFlags;3334    nativeBuildInputs = [makeWrapper];3536    # To clean-up hyperfine output37    postInstall = mkIf forBenchmarks ''38      wrapProgram $out/bin/jrsonnet --add-flags "--max-stack=200000 --os-stack=200000"39    '';4041    cargoLock = {42      lockFile = ../Cargo.lock;43    };44  }