Add dptx-dummy so that dptx.bin gets into the initrd
This commit is contained in:
parent
99a2935bc7
commit
82e28cda1c
1
externals/packages/dptx-dummy/.gitignore
vendored
Normal file
1
externals/packages/dptx-dummy/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
*.cmd
|
26
externals/packages/dptx-dummy/default.nix
vendored
Normal file
26
externals/packages/dptx-dummy/default.nix
vendored
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{ stdenv, lib, kernel }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "dptx-dummy";
|
||||||
|
version = "0.1";
|
||||||
|
src = ./src;
|
||||||
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
||||||
|
setSourceRoot = ''
|
||||||
|
export sourceRoot=$(pwd)/src;
|
||||||
|
'';
|
||||||
|
makeFlags = [
|
||||||
|
"-C"
|
||||||
|
"${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
||||||
|
"M=$(sourceRoot)"
|
||||||
|
];
|
||||||
|
buildFlags = [ "modules" ];
|
||||||
|
installFlags = [ "INSTALL_MOD_PATH=${placeholder "out"}" ];
|
||||||
|
installTargets = [ "modules_install" ];
|
||||||
|
meta = with lib; {
|
||||||
|
description = "Dummy module that requires rockchip/dptx.bin";
|
||||||
|
homepage = "https://artem.ist";
|
||||||
|
license = licenses.gpl2;
|
||||||
|
maintainers = [ maintainers.artemist ];
|
||||||
|
platforms = platforms.linux;
|
||||||
|
};
|
||||||
|
}
|
1
externals/packages/dptx-dummy/src/Makefile
vendored
Normal file
1
externals/packages/dptx-dummy/src/Makefile
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
obj-m := dptx-dummy.o
|
6
externals/packages/dptx-dummy/src/dptx-dummy.c
vendored
Normal file
6
externals/packages/dptx-dummy/src/dptx-dummy.c
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
#include <linux/module.h>
|
||||||
|
|
||||||
|
MODULE_LICENSE("GPL");
|
||||||
|
MODULE_AUTHOR("Artemis Tosini <me@artem.ist>");
|
||||||
|
MODULE_DESCRIPTION("Dummy module that requires rockchip/dptx.bin");
|
||||||
|
MODULE_FIRMWARE("rockchip/dptx.bin");
|
|
@ -55,5 +55,14 @@
|
||||||
extraConfig = lib.mkForce "HandlePowerKey=lock";
|
extraConfig = lib.mkForce "HandlePowerKey=lock";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
swapDevices = [{
|
||||||
|
device = "/dev/disk/by-partuuid/3f4fb4d3-1e13-f64a-a435-8f866833c2b1";
|
||||||
|
randomEncryption = true;
|
||||||
|
}];
|
||||||
|
|
||||||
|
# rockchip/dptx.bin isn't in the initrd. Instead of fix nixpkgs let's do something incredibly cursed
|
||||||
|
boot.extraModulePackages = [ (pkgs.callPackage ../../externals/packages/dptx-dummy { kernel = config.boot.kernelPackages.kernel; }) ];
|
||||||
|
boot.initrd.availableKernelModules = [ "dptx-dummy" ];
|
||||||
|
|
||||||
system.stateVersion = "21.11";
|
system.stateVersion = "21.11";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue