Files
continuwuity/nix/packages/default.nix
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

90 lines
2.6 KiB
Nix
Raw Normal View History

2026-04-03 10:56:45 -04:00
{
inputs,
2026-04-03 10:56:45 -04:00
self,
...
}:
2025-09-24 14:33:20 +02:00
{
2025-10-21 19:17:55 +02:00
perSystem =
{
self',
lib,
2026-03-30 21:23:00 -04:00
pkgs,
inputs',
system,
2026-04-03 10:56:45 -04:00
craneLib,
mkToolchain,
2026-03-30 21:23:00 -04:00
...
}:
{
packages =
let
mkPackages =
pkgs:
let
fnx = inputs'.fenix.packages;
2026-05-11 15:05:57 +02:00
isStatic = pkgs.stdenv.hostPlatform.isMusl;
craneLib = (inputs.crane.mkLib pkgs).overrideToolchain (
_:
if isStatic then
fnx.combine [
self'.packages.stable-toolchain
(mkToolchain fnx.targets.${pkgs.stdenv.hostPlatform.config}).rust-std
]
else
self'.packages.stable-toolchain
);
default = pkgs.callPackage ./continuwuity.nix {
inherit self craneLib;
liburing = (if isStatic then pkgs.pkgsStatic else pkgs).liburing;
2026-06-20 13:45:25 -04:00
rocksdb = if isStatic then null else self'.packages.rocksdb;
# 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
# for features configuration see `default` package which enables http3 by default
max-perf = default.override {
# compiles slower but with more thorough optimizations
profile = "release-max-perf";
};
2026-06-18 11:11:07 -04:00
max-perf-haswell = max-perf.override {
2026-06-18 11:11:07 -04:00
# compiles explicitly for haswell arch cpus
target_cpu = "haswell";
};
in
{
inherit default max-perf max-perf-haswell;
};
in
2026-06-20 13:45:25 -04:00
{
rocksdb = pkgs.callPackage ./rocksdb.nix { };
}
// (mkPackages pkgs)
// (lib.mapAttrs' (name: value: lib.nameValuePair "${name}-static-x86_64" value) (
mkPackages (
import inputs.nixpkgs {
localSystem = system;
crossSystem = "x86_64-unknown-linux-musl";
}
)
))
// (lib.mapAttrs' (name: value: lib.nameValuePair "${name}-static-aarch64" value) (
mkPackages (
import inputs.nixpkgs {
localSystem = system;
crossSystem = "aarch64-unknown-linux-musl";
}
)
));
2025-10-21 19:17:55 +02:00
};
2025-09-24 14:33:20 +02:00
}