12 rustPlatform.buildRustPackage {
13 pname = "scx_rustscheds";
14 inherit (scx-common) version src;
16 useFetchCargoVendor = true;
17 inherit (scx-common.versionInfo.scx) cargoHash;
19 # Copy compiled headers and libs from scx.cscheds
22 cp -r ${scx.cscheds.dev}/bpftool/* bpftool/
23 cp -r ${scx.cscheds.dev}/libbpf/* libbpf/
28 rustPlatform.bindgenHook
37 BPF_CLANG = lib.getExe llvmPackages.clang;
38 BPF_EXTRA_CFLAGS_PRE_INCL = lib.concatStringsSep " " [
39 "-I${scx.cscheds.dev}/libbpf/src/usr/include"
40 "-I${scx.cscheds.dev}/libbpf/include/uapi"
41 "-I${scx.cscheds.dev}/libbpf/include/linux"
43 RUSTFLAGS = lib.concatStringsSep " " [
44 "-C relocation-model=pic"
48 "-L ${scx.cscheds.dev}/libbpf/src"
57 # Enable this when default kernel in nixpkgs is 6.12+
60 meta = scx-common.meta // {
61 description = "Sched-ext Rust userspace schedulers";
63 This includes Rust based schedulers such as
64 scx_rustland, scx_bpfland, scx_lavd, scx_layered, scx_rlfifo.
67 Sched-ext schedulers are only available on kernels version 6.12 or later.
68 It is recommended to use the latest kernel for the best compatibility.