forked from anduril/jetpack-nixos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisplay-driver.nix
38 lines (29 loc) · 1.12 KB
/
display-driver.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# TODO: Should try to merge with upstream nixpkgs's open.nix nvidia driver
{ stdenv
, lib
, kernel
, gitRepos
, l4tVersion
}:
stdenv.mkDerivation {
pname = "nvidia-display-driver";
version = "jetson_${l4tVersion}";
src = gitRepos."tegra/kernel-src/nv-kernel-display-driver";
setSourceRoot = "sourceRoot=$(echo */nvdisplay)";
patches = [ ./display-driver-reproducibility-fix.patch ];
nativeBuildInputs = kernel.moduleBuildDependencies;
makeFlags = kernel.makeFlags ++ [
"SYSSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
"SYSOUT=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
"MODLIB=$(out)/lib/modules/${kernel.modDirVersion}"
] ++ lib.optionals ((stdenv.buildPlatform != stdenv.hostPlatform) && stdenv.hostPlatform.isAarch64) [
"TARGET_ARCH=aarch64"
];
# Avoid an error in modpost: "__stack_chk_guard" [.../nvidia.ko] undefined
NIX_CFLAGS_COMPILE = "-fno-stack-protector -Wno-implicit-function-declaration";
installTargets = [ "modules_install" ];
enableParallelBuilding = true;
passthru.meta = {
license = with lib.licenses; [ mit /* OR */ gpl2Only ];
};
}