summaryrefslogtreecommitdiff
path: root/overlays/v4l2loopback.nix
diff options
context:
space:
mode:
Diffstat (limited to 'overlays/v4l2loopback.nix')
-rw-r--r--overlays/v4l2loopback.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/overlays/v4l2loopback.nix b/overlays/v4l2loopback.nix
new file mode 100644
index 00000000..335f86a3
--- /dev/null
+++ b/overlays/v4l2loopback.nix
@@ -0,0 +1,37 @@
1final: prev: {
2 linuxPackages_latest = prev.linuxPackages_latest.extend (self: super: {
3 v4l2loopback = super.stdenv.mkDerivation rec {
4 name = "v4l2loopback-${version}-${self.kernel.version}";
5 version = "f62fb9076b6313e5eb82fdcaceadb6b3052f346e";
6
7 src = prev.fetchFromGitHub {
8 owner = "umlaeute";
9 repo = "v4l2loopback";
10 rev = "${version}";
11 sha256 = "VRFtimQQtT8vd1dx5KtUDkmXo3DSOybhNLcAIxQba44=";
12 fetchSubmodules = true;
13 };
14
15 hardeningDisable = [ "format" "pic" ];
16
17 preBuild = ''
18 substituteInPlace Makefile --replace "modules_install" "INSTALL_MOD_PATH=$out modules_install"
19 sed -i '/depmod/d' Makefile
20 export PATH=${final.kmod}/sbin:$PATH
21 '';
22
23 nativeBuildInputs = self.kernel.moduleBuildDependencies;
24 buildInputs = [ final.kmod ];
25
26 makeFlags = [
27 "KERNELRELEASE=${self.kernel.modDirVersion}"
28 "KERNEL_DIR=${self.kernel.dev}/lib/modules/${self.kernel.modDirVersion}/build"
29 ];
30
31 postInstall = ''
32 mkdir -p $out/bin
33 install -m0755 utils/v4l2loopback-ctl $out/bin
34 '';
35 };
36 });
37}