-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
/
default.nix
57 lines (49 loc) · 1.6 KB
/
default.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
lib,
stdenv,
fetchFromGitLab,
kernel,
fetchpatch,
}:
stdenv.mkDerivation rec {
pname = "ddcci-driver";
version = "0.4.5-unstable-2024-09-26";
name = "${pname}-${kernel.version}-${version}";
src = fetchFromGitLab {
owner = "${pname}-linux";
repo = "${pname}-linux";
rev = "0233e1ee5eddb4b8a706464f3097bad5620b65f4";
hash = "sha256-Osvojt8UE+cenOuMoSY+T+sODTAAKkvY/XmBa5bQX88=";
};
patches = [
# See https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux/-/merge_requests/17
(fetchpatch {
url = "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux/-/commit/e0605c9cdff7bf3fe9587434614473ba8b7e5f63.patch";
hash = "sha256-sTq03HtWQBd7Wy4o1XbdmMjXQE2dG+1jajx4HtwBHjM=";
})
];
hardeningDisable = [ "pic" ];
nativeBuildInputs = kernel.moduleBuildDependencies;
prePatch = ''
substituteInPlace ./ddcci/Makefile \
--replace '"$(src)"' '$(PWD)' \
--replace depmod \#
substituteInPlace ./ddcci-backlight/Makefile \
--replace '"$(src)"' '$(PWD)' \
--replace depmod \#
'';
makeFlags = kernel.makeFlags ++ [
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
"KVER=${kernel.modDirVersion}"
"KERNEL_MODLIB=$(out)/lib/modules/${kernel.modDirVersion}"
"INCLUDEDIR=$(out)/include"
];
meta = with lib; {
description = "Kernel module driver for DDC/CI monitors";
homepage = "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ kiike ];
platforms = platforms.linux;
broken = kernel.kernelOlder "5.1";
};
}