system-tools: init

This commit is contained in:
Artturin 2024-10-14 03:08:50 +03:00
parent 348efbceba
commit 7bd8c04003
2 changed files with 59 additions and 0 deletions

View file

@ -33,6 +33,7 @@
sfpi = callPackages ./pkgs/sfpi { };
luwen = callPackage ./pkgs/luwen { };
tools-common = callPackage ./pkgs/tools-common { };
system-tools = callPackage ./pkgs/system-tools { };
flash = callPackage ./pkgs/flash {
pyluwen = self.luwen.pyluwen_0_1;
};
@ -56,6 +57,7 @@
luwen = scope.luwen.luwen;
pyluwen = scope.luwen.pyluwen;
tools-common = scope.tools-common;
system-tools = scope.system-tools;
flash = scope.flash;
umd = scope.umd;
metal = scope.metal;

View file

@ -0,0 +1,57 @@
{
lib,
stdenv,
fetchFromGitHub,
makeWrapper,
bash,
pciutils,
}:
# NOTE: We might not use these files if we end up doing the things it does in nix instead if possible.
stdenv.mkDerivation rec {
pname = "tt-system-tools";
version = "unstable-2024-10-11";
src = fetchFromGitHub {
owner = "tenstorrent";
repo = "tt-system-tools";
rev = "29ba4dc6049eef3cee4314c53720417823ffc667";
hash = "sha256-1Z6I5LAfOdNrTSBm49LyBGkmlhgfXKsAxA867rvDiIE=";
};
strictDeps = true;
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ bash ];
dontBuild = true;
dontConfigure = true;
installPhase = ''
runHook preInstall
install -Dm444 -t $out/lib/systemd/system/ "tenstorrent-hugepages.service"
install -Dm444 -t $out/lib/systemd/system/ 'dev-hugepages\x2d1G.mount'
install -Dm555 -t $out/libexec/ "hugepages-setup.sh"
runHook postInstall
'';
postFixup = ''
substituteInPlace "$out/lib/systemd/system/tenstorrent-hugepages.service" \
--replace-fail "/opt/tenstorrent/bin/hugepages-setup.sh" "$out/libexec/hugepages-setup.sh"
wrapProgram "$out/libexec/hugepages-setup.sh" \
--prefix PATH : ${
lib.makeBinPath [
pciutils # for lspci
]
}
'';
meta = {
homepage = "https://github.com/tenstorrent/tt-system-tools";
license = lib.licenses.asl20;
platforms = lib.platforms.all;
};
}