scx_lavd: package and ship
All checks were successful
flake / flake (push) Successful in 1m18s

This commit is contained in:
Jake Hillion 2024-10-12 00:54:02 +01:00
parent 961acd80d7
commit 2656c0dba9
6 changed files with 1703 additions and 3 deletions

View File

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

View File

@ -16,7 +16,7 @@ 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 ];
environment.systemPackages = with pkgs; [ scx_lavd scx_layered ];
};
}

1646
pkgs/scx/lavd.Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

53
pkgs/scx/lavd.nix Normal file
View File

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

View File

@ -12,11 +12,11 @@ rustPlatform.buildRustPackage rec {
version = "1.0.5-dirty";
cargoRoot = "scheds/rust/scx_layered";
cargoLock.lockFile = ./Cargo.lock;
cargoLock.lockFile = ./layered.Cargo.lock;
postPatch = ''
rm Cargo.toml Cargo.lock
ln -fs ${./Cargo.lock} scheds/rust/scx_layered/Cargo.lock
ln -fs ${./layered.Cargo.lock} scheds/rust/scx_layered/Cargo.lock
'';
nativeBuildInputs = [ pkg-config llvmPackages.clang ];