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

difftreelog

ci use eachDefaultSystem

Yaroslav Bolyukin2024-03-17parent: #00fbb91.patch.diff
in: master

2 files changed

modifiedflake.nixdiffbeforeafterboth
--- a/flake.nix
+++ b/flake.nix
@@ -15,7 +15,7 @@
     rust-overlay,
     ...
   }:
-    flake-utils.lib.eachSystem (with flake-utils.lib.system; [x86_64-linux x86_64-windows]) (
+    flake-utils.lib.eachDefaultSystem (
       system: let
         pkgs = import nixpkgs {
           inherit system;
@@ -34,6 +34,7 @@
           };
       in {
         packages = rec {
+          default = jrsonnet;
           go-jsonnet = pkgs.callPackage ./nix/go-jsonnet.nix {};
           sjsonnet = pkgs.callPackage ./nix/sjsonnet.nix {};
           jsonnet = pkgs.callPackage ./nix/jsonnet.nix {};
modifiednix/jrsonnet.nixdiffbeforeafterboth
before · nix/jrsonnet.nix
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  }
after · nix/jrsonnet.nix
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 = optionalString forBenchmarks ''38      wrapProgram $out/bin/jrsonnet --add-flags "--max-stack=200000 --os-stack=200000"39    '';4041    cargoLock = {42      lockFile = ../Cargo.lock;43    };44  }