Compare commits

..

2 Commits

Author SHA1 Message Date
aviac
027f6a4b02 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)
2026-04-20 17:49:03 +00:00
aviac
42028f155b feat(nix): also add release-max-perf package build to flake outputs 2026-04-20 17:49:03 +00:00
3 changed files with 22 additions and 2 deletions

View File

@@ -71,7 +71,7 @@ runs:
- name: Install timelord-cli and git-warp-time
if: steps.check-binaries.outputs.need-install == 'true'
uses: https://github.com/taiki-e/install-action@055f5df8c3f65ea01cd41e9dc855becd88953486 # v2
uses: https://github.com/taiki-e/install-action@a2352fc6ce487f030a3aa709482d57823eadfb37 # v2
with:
tool: git-warp-time,timelord-cli@3.0.1

View File

@@ -8,7 +8,9 @@
callPackage,
rustPlatform,
cargoExtraArgs ? "",
rustflags ? "",
rocksdb ? callPackage ./rocksdb.nix { },
profile ? "release",
}:
let
# see https://crane.dev/API.html#cranelibfiltercargosources
@@ -35,6 +37,8 @@ let
env = {
ROCKSDB_INCLUDE_DIR = "${rocksdb}/include";
ROCKSDB_LIB_DIR = "${rocksdb}/lib";
CARGO_PROFILE = profile;
RUSTFLAGS = rustflags;
};
};
in

View File

@@ -5,6 +5,7 @@
{
perSystem =
{
self',
pkgs,
craneLib,
...
@@ -12,7 +13,22 @@
{
packages = {
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
#
# other examples include:
#
# - release-high-perf
max-perf = self'.packages.default.override {
profile = "release-max-perf";
};
};
};
}