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 2a6bdd868a
3 changed files with 58 additions and 0 deletions

View File

@ -31,6 +31,7 @@
(final: prev: {
unstable = nixpkgs-unstable.legacyPackages.${prev.system};
"storj" = final.callPackage ./pkgs/storj.nix { };
"scx_layered" = final.callPackage ./pkgs/scx/layered.nix { };
})
];
in

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 ];
};
}

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

@ -0,0 +1,55 @@
{ stdenv, lib, fetchFromGitHub, rustPlatform, ... }:
rustPlatform.buildRustPackage rec {
pname = "scx_layered";
src = fetchFromGitHub {
owner = "JakeHillion";
repo = "scx";
rev = "d8150c1913890c79b408073f95e094285b5b4927";
hash = "sha256-nb2bzEanPPWTUhMmGw/8/bwOkdgNmwoZX2lMFq5Av5Q=";
};
version = "1.0.5-dirty";
cargoRoot = "scheds/rust/scx_layered";
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 $out
cp target/${stdenv.targetPlatform.config}/release/scx_layered $out/
runHook postInstall
'';
enableParallelBuilding = true;
dontStrip = true;
dontPatchELF = true;
meta = with lib; {
homepage = "https://bit.ly/scx_slack";
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;
}];
};
}