Unverified Commit bc268e6f authored by Atemu's avatar Atemu Committed by GitHub
Browse files

Merge pull request #334578 from ryanccn/nrr

nrr: enable LTO by default
parents eb0687b6 ff5ec08f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -162,3 +162,6 @@ fc7a83f8b62e90de5679e993d4d49ca014ea013d

# darwin.stdenv: format with nixfmt-rfc-style (#333962)
93c10ac9e561c6594d3baaeaff2341907390d9b8

# nrr: format with nixfmt-rfc-style (#334578)
cffc27daf06c77c0d76bc35d24b929cb9d68c3c9
+18 −12
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, darwin
, pkg-config
, libiconv
, nrxAlias ? true
{
  lib,
  stdenv,
  fetchFromGitHub,
  rustPlatform,
  darwin,
  pkg-config,
  libiconv,
  enableLTO ? true,
  nrxAlias ? true,
}:

rustPlatform.buildRustPackage rec {
  pname = "nrr";
  version = "0.9.4";
  __structuredAttrs = true;

  src = fetchFromGitHub {
    owner = "ryanccn";
@@ -28,14 +30,18 @@ rustPlatform.buildRustPackage rec {
    libiconv
  ];

  nativeBuildInputs = [
    pkg-config
  ];
  nativeBuildInputs = [ pkg-config ];

  env = lib.optionalAttrs enableLTO {
    CARGO_PROFILE_RELEASE_LTO = "fat";
    CARGO_PROFILE_RELEASE_CODEGEN_UNITS = "1";
  };

  postInstall = lib.optionalString nrxAlias "ln -s $out/bin/nr{r,x}";

  meta = with lib; {
    description = "Minimal, blazing fast npm scripts runner";
    homepage = "https://github.com/ryanccn/nrr";
    maintainers = with maintainers; [ ryanccn ];
    license = licenses.gpl3Only;
    mainProgram = "nrr";