nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 43 lines 1.0 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 kernel, 6}: 7stdenv.mkDerivation (finalAttrs: { 8 pname = "tt-kmd"; 9 version = "2.0.0"; 10 11 src = fetchFromGitHub { 12 owner = "tenstorrent"; 13 repo = "tt-kmd"; 14 tag = "ttkmd-${finalAttrs.version}"; 15 hash = "sha256-Y85857oWzsltRyRWpK8Wi0H38mBFwqM3+iXkwVK4DPY="; 16 }; 17 18 nativeBuildInputs = kernel.moduleBuildDependencies; 19 20 buildFlags = [ 21 "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" 22 ]; 23 24 installFlags = finalAttrs.buildFlags ++ [ 25 "INSTALL_MOD_PATH=${placeholder "out"}" 26 "INSTALL_MOD_DIR=misc" 27 ]; 28 29 installTargets = [ "modules_install" ]; 30 31 postInstall = '' 32 mkdir -p $out/lib/udev/rules.d 33 cp udev-50-tenstorrent.rules $out/lib/udev/rules.d/50-tenstorrent.rules 34 ''; 35 36 meta = { 37 description = "Tenstorrent Kernel Module"; 38 homepage = "https://github.com/tenstorrent/tt-kmd"; 39 maintainers = with lib.maintainers; [ RossComputerGuy ]; 40 license = with lib.licenses; [ gpl2Only ]; 41 platforms = lib.platforms.linux; 42 }; 43})