nixos-x13s/packages/default.nix

50 lines
1.2 KiB
Nix

{
inputs,
lib,
pkgs,
...
}:
let
linux_x13s_pkg =
{ version, buildLinux, ... }@args:
buildLinux (
args
// {
modDirVersion = version;
kernelPatches = (args.kernelPatches or [ ]) ++ [
{
name = "compress-kernel-modules";
patch = null;
extraConfig = ''
MODULE_COMPRESS y
MODULE_COMPRESS_ALL y
MODULE_COMPRESS_XZ y
'';
}
];
extraMeta.branch = lib.versions.majorMinor version;
}
);
in
{
linux_jhovold = pkgs.callPackage linux_x13s_pkg {
src = inputs.linux-jhovold;
version = "6.12.0-rc2";
defconfig = "johan_defconfig";
};
graphics-firmware =
let
gpu-src = pkgs.fetchurl {
url = "https://download.lenovo.com/pccbbs/mobiles/n3hdr20w.exe";
hash = "sha256-Jwyl9uKOnjpwfHd+VaGHjYs9x8cUuRdFCERuXqaJwEY=";
};
in
pkgs.runCommand "graphics-firmware" { } ''
mkdir -vp "$out/lib/firmware/qcom/sc8280xp/LENOVO/21BX"
${lib.getExe pkgs.innoextract} ${gpu-src}
cp -v code\$GetExtractPath\$/*/*.mbn "$out/lib/firmware/qcom/sc8280xp/LENOVO/21BX/"
'';
}