-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
36 lines (30 loc) · 955 Bytes
/
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
{ pkgs ? import <nixpkgs> {},
stdenv ? pkgs.stdenv,
kernel1 ? pkgs.linuxKernel.kernels.linux_5_15,
# kernel1 ? pkgs.linuxKernel.kernels.linux_6_1,
# kernel1 ? pkgs.linuxKernel.kernels.linux_zen,
nukeReferences ? pkgs.nukeReferences
}:
stdenv.mkDerivation rec {
name = "heartbeat-timer-${version}-${kernel.version}";
version = "1.0";
src = ./.;
buildInputs = [ nukeReferences ];
hardeningDisable = [ "pic" ];
kernel = kernel1.dev;
kernelVersion = kernel.modDirVersion;
buildPhase = ''
# missing some "touch" commands, make sure they exist for build.
touch .bmd-support.o.cmd
make -C $kernel/lib/modules/$kernelVersion/build modules "M=$(pwd -P)"
'';
installPhase = ''
mkdir -p $out/lib/modules/$kernelVersion/misc
for x in $(find . -name '*.ko'); do
nuke-refs $x
cp $x $out/lib/modules/$kernelVersion/misc/
done
cp insmod.sh $out/
'';
meta.platforms = [ "x86_64-linux" ];
}