1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 kernel,
6 kernelModuleMakeFlags,
7 kmod,
8 nixosTests,
9}:
10
11stdenv.mkDerivation {
12 pname = "fanout";
13 version = "unstable-2022-10-17-${kernel.version}";
14
15 src = fetchFromGitHub {
16 owner = "bob-linuxtoys";
17 repo = "fanout";
18 rev = "69b1cc69bf425d1a5f83b4e84d41272f1caa0144";
19 hash = "sha256-Q19c88KDFu0A6MejZgKYei9J2693EjRkKtR9hcRcHa0=";
20 };
21
22 preBuild = ''
23 substituteInPlace Makefile --replace "modules_install" "INSTALL_MOD_PATH=$out modules_install"
24 '';
25
26 patches = [
27 ./remove_auto_mknod.patch
28 ];
29
30 hardeningDisable = [
31 "format"
32 "pic"
33 ];
34
35 nativeBuildInputs = [ kmod ] ++ kernel.moduleBuildDependencies;
36
37 makeFlags = kernelModuleMakeFlags ++ [
38 "KERNELDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
39 ];
40
41 passthru.tests = { inherit (nixosTests) fanout; };
42
43 meta = with lib; {
44 description = "Kernel-based publish-subscribe system";
45 homepage = "https://github.com/bob-linuxtoys/fanout";
46 license = licenses.gpl2Only;
47 maintainers = with maintainers; [ therishidesai ];
48 platforms = platforms.linux;
49 };
50}