scx_layered: package and ship
Some checks failed
flake / flake (push) Has been cancelled

This commit is contained in:
Jake Hillion 2024-10-11 16:09:52 +01:00
parent eb07e4c4fd
commit f6c804c927
4 changed files with 1737 additions and 0 deletions

View File

@ -30,6 +30,8 @@
getSystemOverlays = system: nixpkgsConfig: [
(final: prev: {
unstable = nixpkgs-unstable.legacyPackages.${prev.system};
"scx_layered" = final.callPackage ./pkgs/scx/layered.nix { };
"storj" = final.callPackage ./pkgs/storj.nix { };
})
];

View File

@ -15,6 +15,8 @@ in
}];
boot.kernelPackages = if pkgs.linuxPackages.kernelAtLeast "6.12" then pkgs.linuxPackages else (if pkgs.linuxPackages_latest.kernelAtLeast "6.12" then pkgs.linuxPackages_latest else pkgs.unstable.linuxPackages_testing);
environment.systemPackages = with pkgs; [ scx_layered ];
};
}

1672
pkgs/scx/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

61
pkgs/scx/layered.nix Normal file
View File

@ -0,0 +1,61 @@
{ stdenv, lib, fetchFromGitHub, rustPlatform, pkg-config, llvmPackages, elfutils, zlib, ... }:
rustPlatform.buildRustPackage rec {
pname = "scx_layered";
src = fetchFromGitHub {
owner = "sched-ext";
repo = "scx";
rev = "d8150c1913890c79b408073f95e094285b5b4927";
hash = "sha256-Pd5h890jOyrOL0hIiRG91nlCST6cvhT8wpDTTGP3b74=";
};
version = "1.0.5-dirty";
cargoRoot = "scheds/rust/scx_layered";
cargoLock.lockFile = ./Cargo.lock;
postPatch = ''
rm Cargo.toml Cargo.lock
ln -fs ${./Cargo.lock} scheds/rust/scx_layered/Cargo.lock
'';
nativeBuildInputs = [ pkg-config llvmPackages.clang ];
buildInputs = [ elfutils zlib ];
# hardeningDisable = [
# "zerocallusedregs"
# ];
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
preBuild = ''
cd scheds/rust/scx_layered
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp target/${stdenv.targetPlatform.config}/release/scx_layered $out/bin/
runHook postInstall
'';
enableParallelBuilding = true;
dontStrip = true;
dontPatchELF = true;
meta = with lib; {
homepage = "https://github.com/sched-ext/scx";
description = "sched_ext schedulers and tools (scx_layered portion)";
license = licenses.gpl2Only;
platforms = platforms.linux;
maintainers = [{
email = "jake@hillion.co.uk";
matrix = "@jake:hillion.co.uk";
name = "Jake Hillion";
github = "JakeHillion";
githubId = 5712856;
}];
};
}