Skip to content

Commit

Permalink
nix!: rename boolean flags according to convention
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanccn committed Aug 18, 2024
1 parent 113e84a commit 1e11638
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 56 deletions.
88 changes: 46 additions & 42 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ repository = "https://github.com/ryanccn/nrr.git"

[dependencies]
ahash = "0.8.11"
clap = { version = "4.5.15", features = ["derive", "env"] }
clap = { version = "4.5.16", features = ["derive", "env"] }
color-eyre = { version = "0.6.3", default-features = false }
ctrlc = "3.4.4"
ctrlc = "3.4.5"
dotenvy = "0.15.7"
indexmap = { version = "2.3.0", features = ["serde"] }
indexmap = { version = "2.4.0", features = ["serde"] }
itoa = "1.0.11"
owo-colors = { version = "4.0.0", features = ["supports-colors"] }
serde = { version = "1.0.207", features = ["derive"] }
serde = { version = "1.0.208", features = ["derive"] }
shlex = "1.3.0"
simd-json = "0.13.10"
strsim = "0.11.1"
Expand Down
9 changes: 5 additions & 4 deletions nix/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
rustPlatform,
darwin,
pkg-config,
lto ? true,
optimizeSize ? false,
enableLTO ? true,
enableOptimizeSize ? false,
nrxAlias ? true,
}:
rustPlatform.buildRustPackage rec {
pname = passthru.cargoToml.package.name;
inherit (passthru.cargoToml.package) version;

__structuredAttrs = true;
strictDeps = true;

src = lib.fileset.toSource {
root = ../.;
Expand All @@ -38,11 +39,11 @@ rustPlatform.buildRustPackage rec {
nativeBuildInputs = lib.optionals stdenv.isDarwin [ pkg-config ];

env =
lib.optionalAttrs lto {
lib.optionalAttrs enableLTO {
CARGO_PROFILE_RELEASE_LTO = "fat";
CARGO_PROFILE_RELEASE_CODEGEN_UNITS = "1";
}
// lib.optionalAttrs optimizeSize {
// lib.optionalAttrs enableOptimizeSize {
CARGO_PROFILE_RELEASE_OPT_LEVEL = "z";
CARGO_PROFILE_RELEASE_PANIC = "abort";
CARGO_PROFILE_RELEASE_CODEGEN_UNITS = "1";
Expand Down
7 changes: 1 addition & 6 deletions nix/static.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@ let
)
)) targets;

mkPackageWith =
rustPlatform:
nrr.override {
inherit rustPlatform;
lto = true;
};
mkPackageWith = rustPlatform: nrr.override { inherit rustPlatform; };
in
lib.mapAttrs' (
target: rustPlatform: lib.nameValuePair "nrr-static-${target}" (mkPackageWith rustPlatform)
Expand Down

0 comments on commit 1e11638

Please sign in to comment.