diff --git a/pkgs/os-specific/linux/tt-kmd/default.nix b/pkgs/os-specific/linux/tt-kmd/default.nix new file mode 100644 index 000000000000..9de08e1c1824 --- /dev/null +++ b/pkgs/os-specific/linux/tt-kmd/default.nix @@ -0,0 +1,43 @@ +{ + lib, + stdenv, + fetchFromGitHub, + kernel, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "tt-kmd"; + version = "2.0.0"; + + src = fetchFromGitHub { + owner = "tenstorrent"; + repo = "tt-kmd"; + tag = "ttkmd-${finalAttrs.version}"; + hash = "sha256-Y85857oWzsltRyRWpK8Wi0H38mBFwqM3+iXkwVK4DPY="; + }; + + nativeBuildInputs = kernel.moduleBuildDependencies; + + buildFlags = [ + "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + ]; + + installFlags = finalAttrs.buildFlags ++ [ + "INSTALL_MOD_PATH=${placeholder "out"}" + "INSTALL_MOD_DIR=misc" + ]; + + installTargets = [ "modules_install" ]; + + postInstall = '' + mkdir -p $out/lib/udev/rules.d + cp udev-50-tenstorrent.rules $out/lib/udev/rules.d/50-tenstorrent.rules + ''; + + meta = { + description = "Tenstorrent Kernel Module"; + homepage = "https://github.com/tenstorrent/tt-kmd"; + maintainers = with lib.maintainers; [ RossComputerGuy ]; + license = with lib.licenses; [ gpl2Only ]; + platforms = lib.platforms.linux; + }; +}) diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix index ad8688611d6b..f87b1a927afb 100644 --- a/pkgs/top-level/linux-kernels.nix +++ b/pkgs/top-level/linux-kernels.nix @@ -610,6 +610,8 @@ in tp_smapi = callPackage ../os-specific/linux/tp_smapi { }; + tt-kmd = callPackage ../os-specific/linux/tt-kmd { }; + turbostat = callPackage ../os-specific/linux/turbostat { }; corefreq = callPackage ../os-specific/linux/corefreq { };