Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

65 lines
1.6 KiB
Nix

{
stdenv,
lib,
fetchFromGitHub,
kernel,
kernelModuleMakeFlags,
nvidia_x11,
hash,
patches ? [ ],
broken ? false,
}:
stdenv.mkDerivation (
{
pname = "nvidia-open";
version = "${kernel.version}-${nvidia_x11.version}";
src = fetchFromGitHub {
owner = "NVIDIA";
repo = "open-gpu-kernel-modules";
rev = nvidia_x11.version;
inherit hash;
};
inherit patches;
nativeBuildInputs = kernel.moduleBuildDependencies;
makeFlags =
kernelModuleMakeFlags
++ [
"IGNORE_PREEMPT_RT_PRESENCE=1"
"SYSSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
"SYSOUT=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
"MODLIB=$(out)/lib/modules/${kernel.modDirVersion}"
"DATE="
"TARGET_ARCH=${stdenv.hostPlatform.parsed.cpu.name}"
]
++ lib.optionals stdenv.cc.isClang [
"C_INCLUDE_PATH=${lib.getLib stdenv.cc.cc}/lib/clang/${lib.versions.major stdenv.cc.cc.version}/include"
];
installTargets = [ "modules_install" ];
enableParallelBuilding = true;
meta = with lib; {
description = "NVIDIA Linux Open GPU Kernel Module";
homepage = "https://github.com/NVIDIA/open-gpu-kernel-modules";
license = with licenses; [
gpl2Plus
mit
];
platforms = [
"x86_64-linux"
"aarch64-linux"
];
maintainers = with maintainers; [ nickcao ];
inherit broken;
};
}
// lib.optionalAttrs stdenv.hostPlatform.isAarch64 {
env.NIX_CFLAGS_COMPILE = "-fno-stack-protector";
}
)