mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
feat(nix): allow override of RUSTFLAGS for certain features
- enabling the `http3` features requires unstable features, namely `reqwest_unstable` - the main suggestion of cargo is to enable this through RUSTFLAGS - we had no way to customize RUSTFLAGS, now we do - changed the max-perf package to showcase this feature - also turn on http3 by default in both max-perf and the default build (jade approved this)
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
callPackage,
|
callPackage,
|
||||||
rustPlatform,
|
rustPlatform,
|
||||||
cargoExtraArgs ? "",
|
cargoExtraArgs ? "",
|
||||||
|
rustflags ? "",
|
||||||
rocksdb ? callPackage ./rocksdb.nix { },
|
rocksdb ? callPackage ./rocksdb.nix { },
|
||||||
profile ? "release",
|
profile ? "release",
|
||||||
}:
|
}:
|
||||||
@@ -37,6 +38,7 @@ let
|
|||||||
ROCKSDB_INCLUDE_DIR = "${rocksdb}/include";
|
ROCKSDB_INCLUDE_DIR = "${rocksdb}/include";
|
||||||
ROCKSDB_LIB_DIR = "${rocksdb}/lib";
|
ROCKSDB_LIB_DIR = "${rocksdb}/lib";
|
||||||
CARGO_PROFILE = profile;
|
CARGO_PROFILE = profile;
|
||||||
|
RUSTFLAGS = rustflags;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|||||||
@@ -13,7 +13,14 @@
|
|||||||
{
|
{
|
||||||
packages = {
|
packages = {
|
||||||
rocksdb = pkgs.callPackage ./rocksdb.nix { };
|
rocksdb = pkgs.callPackage ./rocksdb.nix { };
|
||||||
default = pkgs.callPackage ./continuwuity.nix { inherit self craneLib; };
|
default = pkgs.callPackage ./continuwuity.nix {
|
||||||
|
inherit self craneLib;
|
||||||
|
# extra features via `cargoExtraArgs`
|
||||||
|
cargoExtraArgs = "-F http3";
|
||||||
|
# extra RUSTFLAGS via `rustflags`
|
||||||
|
# the stuff below is required for http3
|
||||||
|
rustflags = "--cfg reqwest_unstable";
|
||||||
|
};
|
||||||
# users may also override this with other cargo profiles to build for other feature sets
|
# users may also override this with other cargo profiles to build for other feature sets
|
||||||
#
|
#
|
||||||
# other examples include:
|
# other examples include:
|
||||||
|
|||||||
Reference in New Issue
Block a user