moby: use stock NixOS linux kernel, and apply config changes strictly through the boot.kernelPatches module

this is more composable, in case i want to make a kernel that's bootable on multiple devices, e.g.
This commit is contained in:
2024-10-06 07:49:38 +00:00
parent 37ceb63444
commit 974cf4a5a7
2 changed files with 20 additions and 2 deletions

View File

@@ -34,7 +34,6 @@
## REFACTORING: ## REFACTORING:
- fold hosts/modules/ into toplevel modules/ - fold hosts/modules/ into toplevel modules/
- define moby kernel via the nixpkgs options instead of `linux-armbian` package.
- add import checks to my Python nix-shell scripts - add import checks to my Python nix-shell scripts
- consolidate ~/dev and ~/ref - consolidate ~/dev and ~/ref
- ~/dev becomes a link to ~/ref/cat/mine - ~/dev becomes a link to ~/ref/cat/mine

View File

@@ -28,10 +28,29 @@ in
# - cameras, sound, etc untested # - cameras, sound, etc untested
# - linux-sane-pinephonepro (6.11.0; pmos config + nixpkgs config): FAILS TO BOOT # - linux-sane-pinephonepro (6.11.0; pmos config + nixpkgs config): FAILS TO BOOT
# boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux-postmarketos-pinephonepro; # boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux-postmarketos-pinephonepro;
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux-sane-pinephonepro; # boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux-sane-pinephonepro;
# boot.kernelPackages = pkgs.linuxPackagesFor myCustomKernel; # boot.kernelPackages = pkgs.linuxPackagesFor myCustomKernel;
# boot.initrd.extraFiles."/lib".source = "${config.system.modulesTree}/lib"; # boot.initrd.extraFiles."/lib".source = "${config.system.modulesTree}/lib";
boot.kernelPatches = [
{
# TODO: upstream into nixpkgs. <repo:nixos/nixpkgs:pkgs/os-specific/linux/kernel/common-config.nix>
name = "fix-module-builtin-mismatch";
patch = null;
extraStructuredConfig = with lib.kernel; {
# nixpkgs specifies `SUN8I_DE2_CCU = yes`, but that in turn requires `SUNXI_CCU = yes` and NOT `= module`
# symptom: config fails to eval
SUNXI_CCU = yes;
# nixpkgs specifies `DRM = yes`, which causes `DRM_PANEL=y`.
# in <repo:kernel.org/linux:include/drm/drm_panel.h> they branch based on if `CONFIG_BACKLIGHT_DEVICE` is a *builtin*,
# hence we need to build it as a builtin to actually have a backlight!
# same logic happens with nixpkgs `DRM_FBDEV_EMULATION = yes` => implies `CONFIG_DRM_KMS_HELPER=y`
# and <repo:kernel.org/linux:include/drm/display/drm_dp_helper.h>
BACKLIGHT_CLASS_DEVICE = yes;
};
}
];
hardware.deviceTree.overlays = [ hardware.deviceTree.overlays = [
{ {
name = "rk3399-pinephone-pro"; name = "rk3399-pinephone-pro";