mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-06-02 11:03:33 +02:00
Merge 7152b61b92
into d1659c9eb8
This commit is contained in:
commit
6990fff083
|
@ -1,17 +1,44 @@
|
||||||
{ pkgs, ... }:
|
{ 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 = [
|
imports = [ ./modules/fancontrol.nix ];
|
||||||
./modules/fancontrol.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [ (import ./overlay.nix) ];
|
||||||
(import ./overlay.nix)
|
|
||||||
];
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = "armv7l-linux";
|
nixpkgs.hostPlatform = "armv7l-linux";
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "ahci_mvebu" ];
|
boot.initrd.availableKernelModules = [ "ahci_mvebu" ];
|
||||||
|
|
||||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_5_15_helios4;
|
boot.kernelPackages = pkgs.linuxPackagesFor linux_5_15_helios4;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,36 +1,4 @@
|
||||||
final: _prev: {
|
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 {
|
ubootHelios4 = final.buildUBoot rec {
|
||||||
defconfig = "helios4_defconfig";
|
defconfig = "helios4_defconfig";
|
||||||
filesToInstall = [ "u-boot-spl.kwb" ];
|
filesToInstall = [ "u-boot-spl.kwb" ];
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
# this is required to correctly configure the modem as PA source/sink
|
# this is required to correctly configure the modem as PA source/sink
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
.include ${pkgs.librem5-base}/etc/pulse/librem5.pa
|
.include ${config.hardware.librem5.package}/etc/pulse/librem5.pa
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,15 @@
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
let cfg = config.hardware.librem5;
|
let
|
||||||
|
cfg = config.hardware.librem5;
|
||||||
|
linuxPackages_librem5 = pkgs.linuxPackagesFor (pkgs.callPackage ./kernel.nix { });
|
||||||
|
ubootLibrem5 = pkgs.callPackage ./u-boot { };
|
||||||
in {
|
in {
|
||||||
options = {
|
options = {
|
||||||
hardware.librem5 = {
|
hardware.librem5 = {
|
||||||
|
package = lib.mkOption {
|
||||||
|
type = lib.types.package;
|
||||||
|
default = pkgs.callPackage ./librem5-base { };
|
||||||
|
};
|
||||||
wifiCard = lib.mkOption {
|
wifiCard = lib.mkOption {
|
||||||
type = lib.types.enum [ "redpine" "sparklan" "none" ];
|
type = lib.types.enum [ "redpine" "sparklan" "none" ];
|
||||||
description = lib.mdDoc ''
|
description = lib.mdDoc ''
|
||||||
|
@ -42,15 +49,6 @@ in {
|
||||||
lockdownFix = lib.mkDefault true;
|
lockdownFix = lib.mkDefault true;
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
|
||||||
(import ./kernel)
|
|
||||||
(final: prev: {
|
|
||||||
ubootLibrem5 = final.callPackage ./u-boot { };
|
|
||||||
|
|
||||||
librem5-base = final.callPackage ./librem5-base { };
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
kernelParams = [ "rootwait" ];
|
kernelParams = [ "rootwait" ];
|
||||||
|
|
||||||
|
@ -59,12 +57,11 @@ in {
|
||||||
grub.enable = false;
|
grub.enable = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
kernelPackages = lib.mkDefault pkgs.linuxPackages_librem5;
|
kernelPackages = lib.mkDefault linuxPackages_librem5;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.udev.packages = lib.mkIf cfg.installUdevPackages [ pkgs.librem5-base ];
|
services.udev.packages = lib.mkIf cfg.installUdevPackages [ config.hardware.librem5.package ];
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [ ubootLibrem5 ];
|
|
||||||
|
|
||||||
|
environment.systemPackages = [ ubootLibrem5 ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
final: prev: {
|
|
||||||
linuxPackages_librem5 = final.linuxPackagesFor (final.callPackage ./kernel.nix { });
|
|
||||||
}
|
|
|
@ -11,7 +11,7 @@ lib.mkIf config.hardware.librem5.lockdownFix {
|
||||||
systemd.services.librem5-lockdown-support = {
|
systemd.services.librem5-lockdown-support = {
|
||||||
description = "Set up drivers for the orientation and proximity sensors on Librem 5";
|
description = "Set up drivers for the orientation and proximity sensors on Librem 5";
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
serviceConfig.ExecStart = "${pkgs.librem5-base}/bin/lockdown-support.sh";
|
serviceConfig.ExecStart = "${config.hardware.librem5.package}/bin/lockdown-support.sh";
|
||||||
wantedBy = [ "default.target" ];
|
wantedBy = [ "default.target" ];
|
||||||
path = [ pkgs.kmod ];
|
path = [ pkgs.kmod ];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user