From a4e2b7909fc1bdf30c30ef21d388fde0b5cdde4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 6 May 2024 08:41:04 +0200 Subject: [PATCH] helios4: remove need for overlay Note that the linux kernel can and should be accessed through config.kernelPackages.kernel. --- kobol/helios4/default.nix | 43 +++++++++++++++++++++++++++++++-------- kobol/helios4/overlay.nix | 32 ----------------------------- 2 files changed, 35 insertions(+), 40 deletions(-) diff --git a/kobol/helios4/default.nix b/kobol/helios4/default.nix index b40c683..532a757 100644 --- a/kobol/helios4/default.nix +++ b/kobol/helios4/default.nix @@ -1,17 +1,44 @@ { pkgs, ... }: - +let + linux_5_15_helios4 = pkgs.linux_5_15.override { + kernelPatches = [ + # A patch to get both PWM fans working + # the patch has been successfully applied to 5.15 and 5.19 + { + patch = pkgs.fetchpatch { + url = "https://raw.githubusercontent.com/armbian/build/bd3466eef2106ea13e85e821f5d852ff97465e6c/patch/kernel/archive/mvebu-5.15/92-mvebu-gpio-remove-hardcoded-timer-assignment.patch"; + sha256 = "sha256-eQqMp0+MZd30zkl8DE89oB7czvyqCkfwF2k0EZ69jr0="; + }; + } + # support for Wake-On-Lan + { + patch = pkgs.fetchpatch { + url = "https://raw.githubusercontent.com/armbian/build/bd3466eef2106ea13e85e821f5d852ff97465e6c/patch/kernel/archive/mvebu-5.15/92-mvebu-gpio-add_wake_on_gpio_support.patch"; + sha256 = "sha256-OrvnVCU55P0U78jdoxGRJvl29i+Rvq8AdEGSCCpxa2I="; + }; + } + { + patch = pkgs.fetchpatch { + url = "https://raw.githubusercontent.com/armbian/build/bd3466eef2106ea13e85e821f5d852ff97465e6c/patch/kernel/archive/mvebu-5.15/94-helios4-dts-add-wake-on-lan-support.patch"; + sha256 = "sha256-ai4161bTC22023eaVVWsvbk6fQKjkv0P4DQ4DA1Zgow="; + }; + } + ]; + defconfig = "mvebu_v7_defconfig"; + # Make the kernel build a bit faster by disabling GPU modules, which we don't need anyways + structuredExtraConfig = with pkgs.lib.kernel; { + DRM = no; + }; + }; +in { - imports = [ - ./modules/fancontrol.nix - ]; + imports = [ ./modules/fancontrol.nix ]; - nixpkgs.overlays = [ - (import ./overlay.nix) - ]; + nixpkgs.overlays = [ (import ./overlay.nix) ]; nixpkgs.hostPlatform = "armv7l-linux"; boot.initrd.availableKernelModules = [ "ahci_mvebu" ]; - boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_5_15_helios4; + boot.kernelPackages = pkgs.linuxPackagesFor linux_5_15_helios4; } diff --git a/kobol/helios4/overlay.nix b/kobol/helios4/overlay.nix index 41aa9d9..32262c5 100644 --- a/kobol/helios4/overlay.nix +++ b/kobol/helios4/overlay.nix @@ -1,36 +1,4 @@ final: _prev: { - linux_5_15_helios4 = final.linux_5_15.override { - kernelPatches = [ - # A patch to get both PWM fans working - # the patch has been successfully applied to 5.15 and 5.19 - { - patch = final.fetchpatch { - url = "https://raw.githubusercontent.com/armbian/build/bd3466eef2106ea13e85e821f5d852ff97465e6c/patch/kernel/archive/mvebu-5.15/92-mvebu-gpio-remove-hardcoded-timer-assignment.patch"; - sha256 = "sha256-eQqMp0+MZd30zkl8DE89oB7czvyqCkfwF2k0EZ69jr0="; - }; - } - # support for Wake-On-Lan - { - patch = final.fetchpatch { - url = "https://raw.githubusercontent.com/armbian/build/bd3466eef2106ea13e85e821f5d852ff97465e6c/patch/kernel/archive/mvebu-5.15/92-mvebu-gpio-add_wake_on_gpio_support.patch"; - sha256 = "sha256-OrvnVCU55P0U78jdoxGRJvl29i+Rvq8AdEGSCCpxa2I="; - }; - } - { - patch = final.fetchpatch { - url = "https://raw.githubusercontent.com/armbian/build/bd3466eef2106ea13e85e821f5d852ff97465e6c/patch/kernel/archive/mvebu-5.15/94-helios4-dts-add-wake-on-lan-support.patch"; - sha256 = "sha256-ai4161bTC22023eaVVWsvbk6fQKjkv0P4DQ4DA1Zgow="; - }; - } - - ]; - defconfig = "mvebu_v7_defconfig"; - # Make the kernel build a bit faster by disabling GPU modules, which we don't need anyways - structuredExtraConfig = with final.lib.kernel; { - DRM = no; - }; - }; - ubootHelios4 = final.buildUBoot rec { defconfig = "helios4_defconfig"; filesToInstall = [ "u-boot-spl.kwb" ];