nixos-image-thinkpad-t14s-gen6/kernel.nix

133 lines
2.8 KiB
Nix
Raw Normal View History

2024-07-28 23:28:50 +00:00
{ config, lib, pkgs, ... }:
let
linux_x1e_pkg = { buildLinux, ... } @ args:
buildLinux (args // rec {
version = "6.12.0";
modDirVersion = "6.12.0-rc3";
2024-07-28 23:28:50 +00:00
src = pkgs.fetchFromGitHub {
owner = "jhovold";
2024-07-28 23:28:50 +00:00
repo = "linux";
# wip/x1e80100-6.12-rc3
rev = "84318c8e3038f579070e7c5d109d1d2311a5f437";
hash = "sha256-kpuzjqcI4YGS+S9OvIUhm6z8xCGMA5h5+JlcHhoEETM=";
2024-07-28 23:28:50 +00:00
};
kernelPatches = (args.kernelPatches or [ ]);
extraMeta.branch = "6.12";
2024-07-28 23:28:50 +00:00
} // (args.argsOverride or { }));
linux_x1e = pkgs.callPackage linux_x1e_pkg {
defconfig = "johan_defconfig";
};
2024-07-28 23:28:50 +00:00
linuxPackages_x1e = pkgs.recurseIntoAttrs (pkgs.linuxPackagesFor linux_x1e);
in {
hardware = {
deviceTree = {
enable = true;
name = "qcom/x1e78100-lenovo-thinkpad-t14s.dtb";
};
};
2024-07-28 23:28:50 +00:00
boot = {
kernelPackages = linuxPackages_x1e;
kernelPatches = [
{
name = "backlight";
patch = ./patches/backlight.patch;
}
{
name = "bluetooth";
patch = ./patches/bluetooth.patch;
}
{
name = "disable-type-c-dp";
patch = ./patches/disable-type-c-dp.patch;
}
{
name = "vmlinuz.efi";
patch = null;
extraStructuredConfig = with lib.kernel; {
EFI_ZBOOT = lib.mkForce no;
};
}
{
name = "disable-qr-code-panic-screen";
patch = null;
extraStructuredConfig = with lib.kernel; {
DRM_PANIC_SCREEN_QR_CODE = lib.mkForce no;
};
}
{
name = "disable-rust";
patch = null;
extraStructuredConfig = with lib.kernel; {
RUST = lib.mkForce no;
};
}
];
2024-07-28 23:28:50 +00:00
kernelParams = [
2024-07-28 23:28:50 +00:00
"regulator_ignore_unused"
"clk_ignore_unused"
"pd_ignore_unused"
"arm64.nopauth"
"efi=novamap"
"pcie_aspm.policy=powersupersave"
"iommu.strict=0"
"iommu.passthrough=0"
];
supportedFilesystems.zfs = false;
initrd = {
systemd = {
enable = true;
tpm2.enable = false;
};
2024-07-28 23:28:50 +00:00
includeDefaultModules = false;
availableKernelModules = [
"nvme"
"uas"
"usb-storage"
"pcie-qcom"
2024-07-28 23:28:50 +00:00
"gpio-sbu-mux"
"leds-qcom-lpg"
"msm"
"panel-edp"
"pmic-glink-altmode"
"pwm-bl"
"qrtr"
"i2c-core"
"i2c-hid"
"i2c-hid-of"
"i2c-qcom-geni"
"phy-qcom-edp"
"phy-qcom-eusb2-repeater"
"phy-qcom-qmp-combo"
"phy-qcom-qmp-pcie"
"phy-qcom-qmp-usb"
"phy-qcom-snps-eusb2"
"phy-qcom-snps-femto-v2"
"phy-qcom-usb-hs"
"dispcc-x1e80100"
"gpucc-x1e80100"
"tcsrcc-x1e80100"
# fat32
"vfat" "nls-cp437" "nls-iso8859-1"
];
};
};
}