mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-06-02 11:03:33 +02:00
Merge branch 'NixOS:master' into nikolarobottesla-patch-1
This commit is contained in:
commit
a2651e2f9e
|
@ -82,6 +82,7 @@ See code for all available configurations.
|
||||||
| [Apple MacBook Pro 14,1](apple/macbook-pro/14-1) | `<nixos-hardware/apple/macbook-pro/14-1>` |
|
| [Apple MacBook Pro 14,1](apple/macbook-pro/14-1) | `<nixos-hardware/apple/macbook-pro/14-1>` |
|
||||||
| [Apple MacMini (2010, Intel, Nvidia)](apple/macmini/4) | `<nixos-hardware/apple/macmini/4>` |
|
| [Apple MacMini (2010, Intel, Nvidia)](apple/macmini/4) | `<nixos-hardware/apple/macmini/4>` |
|
||||||
| [Apple Macs with a T2 Chip](apple/t2) | `<nixos-hardware/apple/t2>` |
|
| [Apple Macs with a T2 Chip](apple/t2) | `<nixos-hardware/apple/t2>` |
|
||||||
|
| [Asus Pro WS X570-ACE](asus/pro-ws-x570-ace) | `<nixos-hardware/asus/pro-ws-x570-ace>` |
|
||||||
| [Asus ROG Ally RC71L (2023)](asus/ally/rc71l) | `<nixos-hardware/asus/ally/rc71l>` |
|
| [Asus ROG Ally RC71L (2023)](asus/ally/rc71l) | `<nixos-hardware/asus/ally/rc71l>` |
|
||||||
| [Asus ROG Strix G513IM](asus/rog-strix/g513im) | `<nixos-hardware/asus/rog-strix/g513im>` |
|
| [Asus ROG Strix G513IM](asus/rog-strix/g513im) | `<nixos-hardware/asus/rog-strix/g513im>` |
|
||||||
| [Asus ROG Strix G733QS](asus/rog-strix/g733qs) | `<nixos-hardware/asus/rog-strix/g733qs>` |
|
| [Asus ROG Strix G733QS](asus/rog-strix/g733qs) | `<nixos-hardware/asus/rog-strix/g733qs>` |
|
||||||
|
|
|
@ -24,6 +24,8 @@ let
|
||||||
|
|
||||||
pipewirePackage = overrideAudioFiles pkgs.pipewire "spa/plugins/";
|
pipewirePackage = overrideAudioFiles pkgs.pipewire "spa/plugins/";
|
||||||
|
|
||||||
|
tiny-dfrPackage = pkgs.callPackage ./pkgs/tiny-dfr.nix { };
|
||||||
|
|
||||||
apple-set-os-loader-installer = pkgs.stdenv.mkDerivation {
|
apple-set-os-loader-installer = pkgs.stdenv.mkDerivation {
|
||||||
name = "apple-set-os-loader-installer-1.0";
|
name = "apple-set-os-loader-installer-1.0";
|
||||||
src = pkgs.fetchFromGitHub {
|
src = pkgs.fetchFromGitHub {
|
||||||
|
@ -60,9 +62,10 @@ in
|
||||||
boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./pkgs/linux-t2.nix { });
|
boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./pkgs/linux-t2.nix { });
|
||||||
boot.initrd.kernelModules = [ "apple-bce" ];
|
boot.initrd.kernelModules = [ "apple-bce" ];
|
||||||
|
|
||||||
|
services.udev.packages = [ audioFilesUdevRules tiny-dfrPackage ];
|
||||||
|
|
||||||
# For audio
|
# For audio
|
||||||
boot.kernelParams = [ "pcie_ports=compat" "intel_iommu=on" "iommu=pt" ];
|
boot.kernelParams = [ "pcie_ports=compat" "intel_iommu=on" "iommu=pt" ];
|
||||||
services.udev.packages = [ audioFilesUdevRules ];
|
|
||||||
|
|
||||||
hardware.pulseaudio.package = overrideAudioFiles pkgs.pulseaudio "src/modules/";
|
hardware.pulseaudio.package = overrideAudioFiles pkgs.pulseaudio "src/modules/";
|
||||||
|
|
||||||
|
@ -71,18 +74,25 @@ in
|
||||||
pipewire = pipewirePackage;
|
pipewire = pipewirePackage;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# For tiny-dfr
|
||||||
|
systemd.services.tiny-dfr = {
|
||||||
|
enable = true;
|
||||||
|
description = "Tiny Apple silicon touch bar daemon";
|
||||||
|
after = [ "systemd-user-sessions.service" "getty@tty1.service" "plymouth-quit.service" "systemd-logind.service" ];
|
||||||
|
bindsTo = [ "dev-tiny_dfr_display.device" "dev-tiny_dfr_backlight.device" ];
|
||||||
|
startLimitIntervalSec = 30;
|
||||||
|
startLimitBurst = 2;
|
||||||
|
script = "${tiny-dfrPackage}/bin/tiny-dfr";
|
||||||
|
restartTriggers = [ tiny-dfrPackage ];
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.etc."tiny-dfr/config.toml" = {
|
||||||
|
source = "${tiny-dfrPackage}/share/tiny-dfr/config.toml";
|
||||||
|
};
|
||||||
|
|
||||||
# Make sure post-resume.service exists
|
# Make sure post-resume.service exists
|
||||||
powerManagement.enable = true;
|
powerManagement.enable = true;
|
||||||
|
|
||||||
systemd.services.fix-keyboard-backlight-and-touchbar = {
|
|
||||||
path = [ pkgs.kmod ];
|
|
||||||
serviceConfig.ExecStart = ''${pkgs.systemd}/bin/systemd-inhibit --what=sleep --why="fixing keyboard backlight and touchbar must finish before sleep" --mode=delay ${./fix-keyboard-backlight-and-touchbar.sh}'';
|
|
||||||
serviceConfig.Type = "oneshot";
|
|
||||||
description = "reload touchbar driver and restart upower";
|
|
||||||
wantedBy = [ "display-manager.service" "post-resume.target" ];
|
|
||||||
after = [ "post-resume.target" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Activation script to install apple-set-os-loader in order to unlock the iGPU
|
# Activation script to install apple-set-os-loader in order to unlock the iGPU
|
||||||
system.activationScripts.appleSetOsLoader = lib.optionalString t2Cfg.enableAppleSetOsLoader ''
|
system.activationScripts.appleSetOsLoader = lib.optionalString t2Cfg.enableAppleSetOsLoader ''
|
||||||
if [[ -e /boot/efi/efi/boot/bootx64_original.efi ]]; then
|
if [[ -e /boot/efi/efi/boot/bootx64_original.efi ]]; then
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
unload () {
|
|
||||||
if modprobe -r "$1" 2>&1;
|
|
||||||
then echo ok
|
|
||||||
else echo fail
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
wait_unload() {
|
|
||||||
while sleep 1; do
|
|
||||||
output="$(unload "$1")"
|
|
||||||
case "$output" in
|
|
||||||
*is\ in\ use*) :;;
|
|
||||||
*ok*) return 0;;
|
|
||||||
*) echo "modprobe said: $output"; echo giving up; return 1;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
wait_unload apple_touchbar
|
|
||||||
modprobe apple_touchbar
|
|
||||||
|
|
||||||
# After suspend, the inode for the backlight device has changed. This service
|
|
||||||
# simply restarts upower to inform it of that change.
|
|
||||||
systemctl restart upower.service
|
|
|
@ -5,11 +5,11 @@ let
|
||||||
patchRepo = fetchFromGitHub {
|
patchRepo = fetchFromGitHub {
|
||||||
owner = "t2linux";
|
owner = "t2linux";
|
||||||
repo = "linux-t2-patches";
|
repo = "linux-t2-patches";
|
||||||
rev = "46dd873d1d9d12b26916790045008a91a95d0c11";
|
rev = "7cd298e227e95bac9a704ffc8f5ff5e89a1bf4d7";
|
||||||
hash = "sha256-YGUGuzsAJFtZYjIW9d2XU4eGKNvMKCaWXqgqJn5TdeY=";
|
hash = "sha256-Oi3CwQl0IwdVc9w+pbmJjBnyqwLFhbqFwxs5o0mqtbE=";
|
||||||
};
|
};
|
||||||
|
|
||||||
version = "6.5";
|
version = "6.7.7";
|
||||||
majorVersion = with lib; (elemAt (take 1 (splitVersion version)) 0);
|
majorVersion = with lib; (elemAt (take 1 (splitVersion version)) 0);
|
||||||
in
|
in
|
||||||
buildLinux (args // {
|
buildLinux (args // {
|
||||||
|
@ -22,7 +22,7 @@ buildLinux (args // {
|
||||||
src = runCommand "patched-source" {} ''
|
src = runCommand "patched-source" {} ''
|
||||||
cp -r ${fetchzip {
|
cp -r ${fetchzip {
|
||||||
url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz";
|
url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz";
|
||||||
hash = "sha256-qJmVSju69WcvDIbgrbtMyCi+OXUNTzNX2G+/0zwsPR4=";
|
hash = "sha256-j+Ufl6C1Mqjthk18GPt2e7j+i7viauOgNnVy9dJSgaM=";
|
||||||
}} $out
|
}} $out
|
||||||
chmod -R u+w $out
|
chmod -R u+w $out
|
||||||
cd $out
|
cd $out
|
||||||
|
@ -40,10 +40,11 @@ buildLinux (args // {
|
||||||
BT_HCIBCM4377 = module;
|
BT_HCIBCM4377 = module;
|
||||||
BT_HCIUART_BCM = yes;
|
BT_HCIUART_BCM = yes;
|
||||||
BT_HCIUART = module;
|
BT_HCIUART = module;
|
||||||
HID_APPLE_IBRIDGE = module;
|
HID_APPLETB_BL = module;
|
||||||
|
HID_APPLETB_KBD = module;
|
||||||
HID_APPLE = module;
|
HID_APPLE = module;
|
||||||
|
DRM_APPLETBDRM = module;
|
||||||
HID_APPLE_MAGIC_BACKLIGHT = module;
|
HID_APPLE_MAGIC_BACKLIGHT = module;
|
||||||
HID_APPLE_TOUCHBAR = module;
|
|
||||||
HID_SENSOR_ALS = module;
|
HID_SENSOR_ALS = module;
|
||||||
SND_PCM = module;
|
SND_PCM = module;
|
||||||
STAGING = yes;
|
STAGING = yes;
|
||||||
|
|
51
apple/t2/pkgs/tiny-dfr.nix
Normal file
51
apple/t2/pkgs/tiny-dfr.nix
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
{ pkgs, fetchFromGitHub, rustPlatform, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
repo = fetchFromGitHub {
|
||||||
|
owner = "kekrby";
|
||||||
|
repo = "tiny-dfr";
|
||||||
|
rev = "8a5d413cb1dbe2a25b77a9e7f3cb5b9c88ef3ffb";
|
||||||
|
hash = "sha256-l4D7aePz/CYpkRorrvsgIYrvSzoZl59OGcFGJqqJftk=";
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
rustPlatform.buildRustPackage rec {
|
||||||
|
pname = "tiny-dfr";
|
||||||
|
version = repo.rev;
|
||||||
|
|
||||||
|
src = repo;
|
||||||
|
|
||||||
|
cargoLock.lockFile = "${src}/Cargo.lock";
|
||||||
|
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
pkg-config
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
udev
|
||||||
|
glib
|
||||||
|
pango
|
||||||
|
cairo
|
||||||
|
gdk-pixbuf
|
||||||
|
libxml2
|
||||||
|
libinput
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace src/main.rs --replace "/usr/share/tiny-dfr/" "$out/share/tiny-dfr/"
|
||||||
|
'';
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
mkdir -p $out/etc $out/share
|
||||||
|
|
||||||
|
cp -r etc/udev $out/etc/
|
||||||
|
cp -r share/tiny-dfr $out/share/
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with pkgs.lib; {
|
||||||
|
description = "The most basic dynamic function row daemon possible";
|
||||||
|
homepage = "https://github.com/kekrby/tiny-dfr";
|
||||||
|
license = with licenses; [ asl20 bsd3 cc0 isc lgpl21Plus mit mpl20 unicode-dfs-2016 asl20 asl20-llvm mit unlicense ];
|
||||||
|
maintainers = [];
|
||||||
|
};
|
||||||
|
}
|
29
asus/pro-ws-x570-ace/README.wiki
Normal file
29
asus/pro-ws-x570-ace/README.wiki
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
= ASUS Pro WS X570-ACE =
|
||||||
|
|
||||||
|
== Firmware issues ==
|
||||||
|
|
||||||
|
=== BIOS ===
|
||||||
|
|
||||||
|
BIOS version 4805 (and possibly older) has broken <code>X2APIC</code> mode, which in turn breaks <code>amd-pstate</code> support.
|
||||||
|
Other possible config values for <code>APIC</code> are <code>Compatibility</code>, <code>Auto</code> and <code>XAPIC</code>; best results were observed with <code>XAPIC</code>.
|
||||||
|
|
||||||
|
This is the error in dmesg when <code>X2APIC</code> is enabled:
|
||||||
|
|
||||||
|
<code>
|
||||||
|
amd_pstate: the _CPC object is not present in SBIOS or ACPI disabled
|
||||||
|
</code>
|
||||||
|
|
||||||
|
=== IPMI ===
|
||||||
|
|
||||||
|
The IPMI is half-baked and for the most part unusable in a pure Linux environment, see https://forum.level1techs.com/t/remote-management-on-the-asus-pro-ws-x570-ace-under-linux
|
||||||
|
|
||||||
|
== Firmware features ==
|
||||||
|
|
||||||
|
=== IOMMU ===
|
||||||
|
|
||||||
|
The groups are great, it's a good board for VFIO.
|
||||||
|
|
||||||
|
=== ECC Memory ===
|
||||||
|
|
||||||
|
As stated on the product page, it works; explicitly enabling in BIOS might be required.
|
||||||
|
Tested with <code>M391A2K43BB1-CTD</code>.
|
19
asus/pro-ws-x570-ace/default.nix
Normal file
19
asus/pro-ws-x570-ace/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../../common/pc
|
||||||
|
../../common/pc/ssd
|
||||||
|
../../common/cpu/amd/pstate.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.kernelModules = [
|
||||||
|
# Nuvoton NCT6798D - temperature, voltage and RPM
|
||||||
|
"nct6775"
|
||||||
|
|
||||||
|
# a single "temp1" sensor, always at "+31.9°C"
|
||||||
|
# commented because it's not useful, but left here for reference
|
||||||
|
# Bus `SMBus PIIX4 adapter port 1 at 0b20'
|
||||||
|
# Busdriver `i2c_piix4', I2C address 0x4f
|
||||||
|
# Chip `ds75'
|
||||||
|
# "lm75"
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,15 +1,26 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
boot.initrd.kernelModules = [ "i915" ];
|
options.hardware.intelgpu.loadInInitrd = lib.mkEnableOption (lib.mdDoc
|
||||||
|
"loading `i195` kernelModule at stage 1. (Add `i915` to `boot.initrd.kernelModules`)"
|
||||||
environment.variables = {
|
) // {
|
||||||
VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkDefault "va_gl");
|
default = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware.opengl.extraPackages = with pkgs; [
|
config = lib.mkMerge [
|
||||||
(if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel else intel-vaapi-driver)
|
(lib.mkIf config.hardware.intelgpu.loadInInitrd {
|
||||||
libvdpau-va-gl
|
boot.initrd.kernelModules = [ "i915" ];
|
||||||
intel-media-driver
|
})
|
||||||
|
{
|
||||||
|
environment.variables = {
|
||||||
|
VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkDefault "va_gl");
|
||||||
|
};
|
||||||
|
|
||||||
|
hardware.opengl.extraPackages = with pkgs; [
|
||||||
|
(if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel else intel-vaapi-driver)
|
||||||
|
libvdpau-va-gl
|
||||||
|
intel-media-driver
|
||||||
|
];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
asus-ally-rc71l = import ./asus/ally/rc71l;
|
asus-ally-rc71l = import ./asus/ally/rc71l;
|
||||||
asus-fx504gd = import ./asus/fx504gd;
|
asus-fx504gd = import ./asus/fx504gd;
|
||||||
asus-fa507rm = import ./asus/fa507rm;
|
asus-fa507rm = import ./asus/fa507rm;
|
||||||
|
asus-pro-ws-x570-ace = import ./asus/pro-ws-x570-ace;
|
||||||
asus-rog-strix-g513im = import ./asus/rog-strix/g513im;
|
asus-rog-strix-g513im = import ./asus/rog-strix/g513im;
|
||||||
asus-rog-strix-g733qs = import ./asus/rog-strix/g733qs;
|
asus-rog-strix-g733qs = import ./asus/rog-strix/g733qs;
|
||||||
asus-zephyrus-ga401 = import ./asus/zephyrus/ga401;
|
asus-zephyrus-ga401 = import ./asus/zephyrus/ga401;
|
||||||
|
|
|
@ -1,52 +1,62 @@
|
||||||
{ lib, pkgs, ... }: {
|
{ config, lib, pkgs, ... }:
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../common
|
../common
|
||||||
../common/intel.nix
|
../common/intel.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.kernelParams = [
|
config = lib.mkMerge [
|
||||||
# For Power consumption
|
{
|
||||||
# https://kvark.github.io/linux/framework/2021/10/17/framework-nixos.html
|
hardware.intelgpu.loadInInitrd = lib.versionOlder config.boot.kernelPackages.kernel.version "6.2";
|
||||||
"mem_sleep_default=deep"
|
}
|
||||||
# Workaround iGPU hangs
|
# https://community.frame.work/t/tracking-hard-freezing-on-fedora-36-with-the-new-12th-gen-system/20675/391
|
||||||
# https://discourse.nixos.org/t/intel-12th-gen-igpu-freezes/21768/4
|
(lib.mkIf (lib.versionOlder config.boot.kernelPackages.kernel.version "6.2") {
|
||||||
"i915.enable_psr=1"
|
boot.kernelParams = [
|
||||||
|
# Workaround iGPU hangs
|
||||||
|
# https://discourse.nixos.org/t/intel-12th-gen-igpu-freezes/21768/4
|
||||||
|
"i915.enable_psr=1"
|
||||||
|
];
|
||||||
|
})
|
||||||
|
(lib.mkIf (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") {
|
||||||
|
boot.blacklistedKernelModules = [
|
||||||
|
# This enables the brightness and airplane mode keys to work
|
||||||
|
# https://community.frame.work/t/12th-gen-not-sending-xf86monbrightnessup-down/20605/11
|
||||||
|
"hid-sensor-hub"
|
||||||
|
# This fixes controller crashes during sleep
|
||||||
|
# https://community.frame.work/t/tracking-fn-key-stops-working-on-popos-after-a-while/21208/32
|
||||||
|
(lib.mkIf (config.hardware.framework.enableKmod == false) "cros_ec_lpcs")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.kernelParams = [
|
||||||
|
# For Power consumption
|
||||||
|
# https://kvark.github.io/linux/framework/2021/10/17/framework-nixos.html
|
||||||
|
# Update 04/2024: Combined with acpi_osi from framework-intel it increases the idle power-usage in my test (SebTM)
|
||||||
|
# (see: https://github.com/NixOS/nixos-hardware/pull/903#issuecomment-2068146658)
|
||||||
|
"mem_sleep_default=deep"
|
||||||
|
];
|
||||||
|
|
||||||
|
# Further tweak to ensure the brightness and airplane mode keys work
|
||||||
|
# https://community.frame.work/t/responded-12th-gen-not-sending-xf86monbrightnessup-down/20605/67
|
||||||
|
systemd.services.bind-keys-driver = {
|
||||||
|
description = "Bind brightness and airplane mode keys to their driver";
|
||||||
|
wantedBy = [ "default.target" ];
|
||||||
|
after = [ "network.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
User = "root";
|
||||||
|
};
|
||||||
|
script = ''
|
||||||
|
ls -lad /sys/bus/i2c/devices/i2c-*:* /sys/bus/i2c/drivers/i2c_hid_acpi/i2c-*:*
|
||||||
|
if [ -e /sys/bus/i2c/devices/i2c-FRMW0001:00 -a ! -e /sys/bus/i2c/drivers/i2c_hid_acpi/i2c-FRMW0001:00 ]; then
|
||||||
|
echo fixing
|
||||||
|
echo i2c-FRMW0001:00 > /sys/bus/i2c/drivers/i2c_hid_acpi/bind
|
||||||
|
ls -lad /sys/bus/i2c/devices/i2c-*:* /sys/bus/i2c/drivers/i2c_hid_acpi/i2c-*:*
|
||||||
|
echo done
|
||||||
|
else
|
||||||
|
echo no fix needed
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.blacklistedKernelModules = [
|
|
||||||
# This enables the brightness and airplane mode keys to work
|
|
||||||
# https://community.frame.work/t/12th-gen-not-sending-xf86monbrightnessup-down/20605/11
|
|
||||||
"hid-sensor-hub"
|
|
||||||
# This fixes controller crashes during sleep
|
|
||||||
# https://community.frame.work/t/tracking-fn-key-stops-working-on-popos-after-a-while/21208/32
|
|
||||||
"cros_ec_lpcs"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Further tweak to ensure the brightness and airplane mode keys work
|
|
||||||
# https://community.frame.work/t/responded-12th-gen-not-sending-xf86monbrightnessup-down/20605/67
|
|
||||||
systemd.services.bind-keys-driver = {
|
|
||||||
description = "Bind brightness and airplane mode keys to their driver";
|
|
||||||
wantedBy = [ "default.target" ];
|
|
||||||
after = [ "network.target" ];
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
User = "root";
|
|
||||||
};
|
|
||||||
script = ''
|
|
||||||
ls -lad /sys/bus/i2c/devices/i2c-*:* /sys/bus/i2c/drivers/i2c_hid_acpi/i2c-*:*
|
|
||||||
if [ -e /sys/bus/i2c/devices/i2c-FRMW0001:00 -a ! -e /sys/bus/i2c/drivers/i2c_hid_acpi/i2c-FRMW0001:00 ]; then
|
|
||||||
echo fixing
|
|
||||||
echo i2c-FRMW0001:00 > /sys/bus/i2c/drivers/i2c_hid_acpi/bind
|
|
||||||
ls -lad /sys/bus/i2c/devices/i2c-*:* /sys/bus/i2c/drivers/i2c_hid_acpi/i2c-*:*
|
|
||||||
echo done
|
|
||||||
else
|
|
||||||
echo no fix needed
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
# Alder Lake CPUs benefit from kernel 5.18 for ThreadDirector
|
|
||||||
# https://www.tomshardware.com/news/intel-thread-director-coming-to-linux-5-18
|
|
||||||
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.18") (lib.mkDefault pkgs.linuxPackages_latest);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
../../../common/pc/laptop
|
../../../common/pc/laptop
|
||||||
../../../common/pc/laptop/ssd
|
../../../common/pc/laptop/ssd
|
||||||
|
../../kmod.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Fix TRRS headphones missing a mic
|
# Fix TRRS headphones missing a mic
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
{ lib, pkgs, ... }: {
|
{ config, lib, pkgs, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
../../../common/cpu/intel
|
../../../common/cpu/intel
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.kernelParams = [
|
boot.kernelParams = [
|
||||||
# Fixes a regression in s2idle, making it more power efficient than deep sleep
|
|
||||||
"acpi_osi=\"!Windows 2020\""
|
|
||||||
# For Power consumption
|
# For Power consumption
|
||||||
# https://community.frame.work/t/linux-battery-life-tuning/6665/156
|
# https://community.frame.work/t/linux-battery-life-tuning/6665/156
|
||||||
"nvme.noacpi=1"
|
"nvme.noacpi=1"
|
||||||
];
|
]
|
||||||
|
# Fixes a regression in s2idle, making it more power efficient than deep sleep
|
||||||
|
# Update 04/2024: It appears that s2idle-regression got fixed in newer kernel-versions (SebTM)
|
||||||
|
# (see: https://github.com/NixOS/nixos-hardware/pull/903#discussion_r1556096657)
|
||||||
|
++ lib.lists.optional (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") "acpi_osi=\"!Windows 2020\"";
|
||||||
|
|
||||||
# Requires at least 5.16 for working wi-fi and bluetooth.
|
# Requires at least 5.16 for working wi-fi and bluetooth.
|
||||||
# https://community.frame.work/t/using-the-ax210-with-linux-on-the-framework-laptop/1844/89
|
# https://community.frame.work/t/using-the-ax210-with-linux-on-the-framework-laptop/1844/89
|
||||||
|
|
17
framework/kmod.nix
Normal file
17
framework/kmod.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
{
|
||||||
|
options.hardware.framework.enableKmod = lib.mkEnableOption (lib.mdDoc
|
||||||
|
"Enable the community created Framework kernel module that allows interacting with the embedded controller from sysfs."
|
||||||
|
) // {
|
||||||
|
# Enable by default if on new enough version of NixOS
|
||||||
|
default = (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.05");
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.hardware.framework.enableKmod {
|
||||||
|
boot.extraModulePackages = with config.boot.kernelPackages; [
|
||||||
|
framework-laptop-kmod
|
||||||
|
];
|
||||||
|
# https://github.com/DHowett/framework-laptop-kmod?tab=readme-ov-file#usage
|
||||||
|
boot.kernelModules = [ "cros_ec" "cros_ec_lpcs" ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -6,4 +6,8 @@
|
||||||
boot.initrd.kernelModules = [
|
boot.initrd.kernelModules = [
|
||||||
"sdhci_pci" # 16G eMMC on board
|
"sdhci_pci" # 16G eMMC on board
|
||||||
];
|
];
|
||||||
|
|
||||||
|
boot.kernelModules = [
|
||||||
|
"it87" # ITE IT8786E Super IO Sensors
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +1,9 @@
|
||||||
{ lib
|
{ buildUBoot
|
||||||
, fetchFromGitHub
|
|
||||||
, buildUBoot
|
|
||||||
, buildPackages
|
|
||||||
, opensbi
|
, opensbi
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildUBoot rec {
|
buildUBoot {
|
||||||
version = "2024.01";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "u-boot";
|
|
||||||
repo = "u-boot";
|
|
||||||
rev = "refs/tags/v${version}";
|
|
||||||
hash = "sha256-0Da7Czy9cpQ+D5EICc3/QSZhAdCBsmeMvBgykYhAQFw=";
|
|
||||||
};
|
|
||||||
|
|
||||||
# workaround for https://github.com/NixOS/nixpkgs/pull/146634
|
|
||||||
# uboot: only apply raspberry pi patches to raspberry pi builds
|
|
||||||
patches = [ ];
|
|
||||||
|
|
||||||
extraMakeFlags = [
|
extraMakeFlags = [
|
||||||
# workaround for https://github.com/NixOS/nixpkgs/pull/277997
|
|
||||||
# buildUBoot: specify absolute path of dtc, fix building u-boot 2023.10+
|
|
||||||
"DTC=${lib.getExe buildPackages.dtc}"
|
|
||||||
|
|
||||||
"OPENSBI=${opensbi}/share/opensbi/lp64/generic/firmware/fw_dynamic.bin"
|
"OPENSBI=${opensbi}/share/opensbi/lp64/generic/firmware/fw_dynamic.bin"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user