Merge branch 'master' into raspberry-pi-5
This commit is contained in:
commit
2dcc936ab2
|
@ -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 MacMini (2010, Intel, Nvidia)](apple/macmini/4) | `<nixos-hardware/apple/macmini/4>` |
|
||||
| [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 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>` |
|
||||
|
@ -94,6 +95,7 @@ See code for all available configurations.
|
|||
| [Asus ROG Zephyrus M16 GU603H](asus/zephyrus/gu603h) | `<nixos-hardware/asus/zephyrus/gu603h>` |
|
||||
| [Asus TUF FX504GD](asus/fx504gd) | `<nixos-hardware/asus/fx504gd>` |
|
||||
| [Asus TUF FA507RM](asus/fa507rm) | `<nixos-hardware/asus/fa507rm>` |
|
||||
| [Asus TUF FA507NV](asus/fa507nv) | `<nixos-hardware/asus/fa507nv>` |
|
||||
| [BeagleBoard PocketBeagle](beagleboard/pocketbeagle) | `<nixos-hardware/beagleboard/pocketbeagle>` |
|
||||
| [Deciso DEC series](deciso/dec) | `<nixos-hardware/deciso/dec>` |
|
||||
| [Dell G3 3779](dell/g3/3779) | `<nixos-hardware/dell/g3/3779>` |
|
||||
|
@ -156,6 +158,7 @@ See code for all available configurations.
|
|||
| [GPD WIN Max 2 2023](gpd/win-max-2/2023) | `<nixos-hardware/gpd/win-max-2/2023>` |
|
||||
| [Google Pixelbook](google/pixelbook) | `<nixos-hardware/google/pixelbook>` |
|
||||
| [HP Elitebook 2560p](hp/elitebook/2560p) | `<nixos-hardware/hp/elitebook/2560p>` |
|
||||
| [HP Elitebook 830g6](hp/elitebook/830/g6) | `<nixos-hardware/hp/elitebook/830/g6>` |
|
||||
| [HP Elitebook 845g7](hp/elitebook/845/g7) | `<nixos-hardware/hp/elitebook/845/g7>` |
|
||||
| [HP Elitebook 845g8](hp/elitebook/845/g8) | `<nixos-hardware/hp/elitebook/845/g8>` |
|
||||
| [HP Elitebook 845g9](hp/elitebook/845/g9) | `<nixos-hardware/hp/elitebook/845/g9>` |
|
||||
|
@ -184,6 +187,7 @@ See code for all available configurations.
|
|||
| [Lenovo ThinkPad L13](lenovo/thinkpad/l13) | `<nixos-hardware/lenovo/thinkpad/l13>` |
|
||||
| [Lenovo ThinkPad L14 (AMD)](lenovo/thinkpad/l14/amd) | `<nixos-hardware/lenovo/thinkpad/l14/amd>` |
|
||||
| [Lenovo ThinkPad L14 (Intel)](lenovo/thinkpad/l14/intel) | `<nixos-hardware/lenovo/thinkpad/l14/intel>` |
|
||||
| [Lenovo ThinkPad L480](lenovo/thinkpad/l480) | `<nixos-hardware/lenovo/thinkpad/l480>` |
|
||||
| [Lenovo ThinkPad P1 Gen 3](lenovo/thinkpad/p1/3th-gen) | `<nixos-hardware/lenovo/thinkpad/p1/3th-gen>` |
|
||||
| [Lenovo ThinkPad P14s AMD Gen 2](lenovo/thinkpad/p14s/amd/gen2) | `<nixos-hardware/lenovo/thinkpad/p14s/amd/gen2>` |
|
||||
| [Lenovo ThinkPad P16s AMD Gen 1](lenovo/thinkpad/p16s/amd/gen1) | `<nixos-hardware/lenovo/thinkpad/p16s/amd/gen1>` |
|
||||
|
|
|
@ -24,6 +24,8 @@ let
|
|||
|
||||
pipewirePackage = overrideAudioFiles pkgs.pipewire "spa/plugins/";
|
||||
|
||||
tiny-dfrPackage = pkgs.callPackage ./pkgs/tiny-dfr.nix { };
|
||||
|
||||
apple-set-os-loader-installer = pkgs.stdenv.mkDerivation {
|
||||
name = "apple-set-os-loader-installer-1.0";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
|
@ -60,9 +62,10 @@ in
|
|||
boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./pkgs/linux-t2.nix { });
|
||||
boot.initrd.kernelModules = [ "apple-bce" ];
|
||||
|
||||
services.udev.packages = [ audioFilesUdevRules tiny-dfrPackage ];
|
||||
|
||||
# For audio
|
||||
boot.kernelParams = [ "pcie_ports=compat" "intel_iommu=on" "iommu=pt" ];
|
||||
services.udev.packages = [ audioFilesUdevRules ];
|
||||
|
||||
hardware.pulseaudio.package = overrideAudioFiles pkgs.pulseaudio "src/modules/";
|
||||
|
||||
|
@ -71,18 +74,25 @@ in
|
|||
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
|
||||
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
|
||||
system.activationScripts.appleSetOsLoader = lib.optionalString t2Cfg.enableAppleSetOsLoader ''
|
||||
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 {
|
||||
owner = "t2linux";
|
||||
repo = "linux-t2-patches";
|
||||
rev = "46dd873d1d9d12b26916790045008a91a95d0c11";
|
||||
hash = "sha256-YGUGuzsAJFtZYjIW9d2XU4eGKNvMKCaWXqgqJn5TdeY=";
|
||||
rev = "7cd298e227e95bac9a704ffc8f5ff5e89a1bf4d7";
|
||||
hash = "sha256-Oi3CwQl0IwdVc9w+pbmJjBnyqwLFhbqFwxs5o0mqtbE=";
|
||||
};
|
||||
|
||||
version = "6.5";
|
||||
version = "6.7.7";
|
||||
majorVersion = with lib; (elemAt (take 1 (splitVersion version)) 0);
|
||||
in
|
||||
buildLinux (args // {
|
||||
|
@ -22,7 +22,7 @@ buildLinux (args // {
|
|||
src = runCommand "patched-source" {} ''
|
||||
cp -r ${fetchzip {
|
||||
url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz";
|
||||
hash = "sha256-qJmVSju69WcvDIbgrbtMyCi+OXUNTzNX2G+/0zwsPR4=";
|
||||
hash = "sha256-j+Ufl6C1Mqjthk18GPt2e7j+i7viauOgNnVy9dJSgaM=";
|
||||
}} $out
|
||||
chmod -R u+w $out
|
||||
cd $out
|
||||
|
@ -40,10 +40,11 @@ buildLinux (args // {
|
|||
BT_HCIBCM4377 = module;
|
||||
BT_HCIUART_BCM = yes;
|
||||
BT_HCIUART = module;
|
||||
HID_APPLE_IBRIDGE = module;
|
||||
HID_APPLETB_BL = module;
|
||||
HID_APPLETB_KBD = module;
|
||||
HID_APPLE = module;
|
||||
DRM_APPLETBDRM = module;
|
||||
HID_APPLE_MAGIC_BACKLIGHT = module;
|
||||
HID_APPLE_TOUCHBAR = module;
|
||||
HID_SENSOR_ALS = module;
|
||||
SND_PCM = module;
|
||||
STAGING = yes;
|
||||
|
|
|
@ -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 = [];
|
||||
};
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
# ASUS TUF A15 FA507NV
|
||||
As Nvidia offload is not available for AMD CPU, nvidia prime is using sync. Additionally the kernel is set to the latest stable release(using boot.kernelPackages = pkgs.linuxPackages_latest) as the keyboard and wireless drivers does not work in the default NixOS kernel which is the LTS kernel.
|
|
@ -0,0 +1,21 @@
|
|||
{ lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../common/cpu/amd
|
||||
../../common/cpu/amd/raphael/igpu.nix
|
||||
../../common/cpu/amd/pstate.nix
|
||||
../../common/gpu/nvidia
|
||||
../../common/gpu/nvidia/prime-sync.nix
|
||||
../../common/hidpi.nix
|
||||
../../common/pc/laptop
|
||||
../../common/pc/ssd
|
||||
];
|
||||
|
||||
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.6") pkgs.linuxPackages_latest;
|
||||
|
||||
hardware.nvidia.prime = {
|
||||
amdgpuBusId = "PCI:54:0:0";
|
||||
nvidiaBusId = "PCI:1:0:0";
|
||||
};
|
||||
}
|
|
@ -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>.
|
|
@ -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, ... }:
|
||||
|
||||
{
|
||||
boot.initrd.kernelModules = [ "i915" ];
|
||||
|
||||
environment.variables = {
|
||||
VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkDefault "va_gl");
|
||||
options.hardware.intelgpu.loadInInitrd = lib.mkEnableOption (lib.mdDoc
|
||||
"loading `i195` kernelModule at stage 1. (Add `i915` to `boot.initrd.kernelModules`)"
|
||||
) // {
|
||||
default = true;
|
||||
};
|
||||
|
||||
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
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf config.hardware.intelgpu.loadInInitrd {
|
||||
boot.initrd.kernelModules = [ "i915" ];
|
||||
})
|
||||
{
|
||||
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
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
{
|
||||
imports = [ ./. ];
|
||||
|
||||
hardware.nvidia.prime = {
|
||||
# For people who want to use sync instead of offload. Especially for AMD CPU users
|
||||
sync.enable = lib.mkOverride 990 true;
|
||||
};
|
||||
}
|
|
@ -18,7 +18,9 @@
|
|||
asus-battery = import ./asus/battery.nix;
|
||||
asus-ally-rc71l = import ./asus/ally/rc71l;
|
||||
asus-fx504gd = import ./asus/fx504gd;
|
||||
asus-fa507nv = import ./asus/fa507nv;
|
||||
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-g733qs = import ./asus/rog-strix/g733qs;
|
||||
asus-zephyrus-ga401 = import ./asus/zephyrus/ga401;
|
||||
|
@ -88,6 +90,7 @@
|
|||
gpd-win-2 = import ./gpd/win-2;
|
||||
gpd-win-max-2-2023 = import ./gpd/win-max-2/2023;
|
||||
hp-elitebook-2560p = import ./hp/elitebook/2560p;
|
||||
hp-elitebook-830g6 = import ./hp/elitebook/830/g6;
|
||||
hp-elitebook-845g7 = import ./hp/elitebook/845/g7;
|
||||
hp-elitebook-845g8 = import ./hp/elitebook/845/g8;
|
||||
hp-elitebook-845g9 = import ./hp/elitebook/845/g9;
|
||||
|
@ -118,6 +121,7 @@
|
|||
lenovo-thinkpad-l13-yoga = import ./lenovo/thinkpad/l13/yoga;
|
||||
lenovo-thinkpad-l14-amd = import ./lenovo/thinkpad/l14/amd;
|
||||
lenovo-thinkpad-l14-intel = import ./lenovo/thinkpad/l14/intel;
|
||||
lenovo-thinkpad-l480 = import ./lenovo/thinkpad/l480;
|
||||
lenovo-thinkpad-p1 = import ./lenovo/thinkpad/p1;
|
||||
lenovo-thinkpad-p1-gen3 = import ./lenovo/thinkpad/p1/3th-gen;
|
||||
lenovo-thinkpad-p14s-amd-gen2 = import ./lenovo/thinkpad/p14s/amd/gen2;
|
||||
|
@ -248,6 +252,7 @@
|
|||
common-gpu-intel = import ./common/gpu/intel;
|
||||
common-gpu-intel-disable = import ./common/gpu/intel/disable.nix;
|
||||
common-gpu-nvidia = import ./common/gpu/nvidia/prime.nix;
|
||||
common-gpu-nvidia-sync = import ./common/gpu/nvidia/prime-sync.nix;
|
||||
common-gpu-nvidia-nonprime = import ./common/gpu/nvidia;
|
||||
common-gpu-nvidia-disable = import ./common/gpu/nvidia/disable.nix;
|
||||
common-hidpi = import ./common/hidpi.nix;
|
||||
|
|
|
@ -1,52 +1,62 @@
|
|||
{ lib, pkgs, ... }: {
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
../common
|
||||
../common/intel.nix
|
||||
];
|
||||
|
||||
boot.kernelParams = [
|
||||
# For Power consumption
|
||||
# https://kvark.github.io/linux/framework/2021/10/17/framework-nixos.html
|
||||
"mem_sleep_default=deep"
|
||||
# Workaround iGPU hangs
|
||||
# https://discourse.nixos.org/t/intel-12th-gen-igpu-freezes/21768/4
|
||||
"i915.enable_psr=1"
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
hardware.intelgpu.loadInInitrd = lib.versionOlder config.boot.kernelPackages.kernel.version "6.2";
|
||||
}
|
||||
# https://community.frame.work/t/tracking-hard-freezing-on-fedora-36-with-the-new-12th-gen-system/20675/391
|
||||
(lib.mkIf (lib.versionOlder config.boot.kernelPackages.kernel.version "6.2") {
|
||||
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 = [
|
||||
../../../common/pc/laptop
|
||||
../../../common/pc/laptop/ssd
|
||||
../../kmod.nix
|
||||
];
|
||||
|
||||
# Fix TRRS headphones missing a mic
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
{ lib, pkgs, ... }: {
|
||||
{ config, lib, pkgs, ... }: {
|
||||
imports = [
|
||||
../../../common/cpu/intel
|
||||
];
|
||||
|
||||
boot.kernelParams = [
|
||||
# Fixes a regression in s2idle, making it more power efficient than deep sleep
|
||||
"acpi_osi=\"!Windows 2020\""
|
||||
boot.kernelParams = [
|
||||
# For Power consumption
|
||||
# https://community.frame.work/t/linux-battery-life-tuning/6665/156
|
||||
"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.
|
||||
# https://community.frame.work/t/using-the-ax210-with-linux-on-the-framework-laptop/1844/89
|
||||
|
|
|
@ -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" ];
|
||||
};
|
||||
}
|
|
@ -3,10 +3,9 @@ with lib;
|
|||
{
|
||||
config = {
|
||||
# Wifi can't connect if rand mac address is used
|
||||
networking.networkmanager.extraConfig = concatStringsSep "\n" [
|
||||
"[device]"
|
||||
"match-device=driver:iwlwifi"
|
||||
"wifi.scan-rand-mac-address=no"
|
||||
];
|
||||
networking.networkmanager.settings.device = {
|
||||
match-device = "driver:iwlwifi";
|
||||
wifi.scan-rand-mac-address = "no";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
# HP Elitebook 830 G6
|
||||
|
||||
## solved problems
|
||||
* KDE Plasma 5 (haven't tested others), ~20% of the time freezes at login screen on resume - setting hardare.enableAllFirmware seems to fix
|
||||
|
||||
## Unsolved Problems
|
||||
|
||||
* sometimes fails to sleep (seems to be an application causing it, so probably not a driver/kernel problem)
|
|
@ -0,0 +1,26 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
../../../../common/cpu/intel
|
||||
../../../../common/pc/laptop
|
||||
../../../../common/pc/laptop/acpi_call.nix
|
||||
../../../../common/pc/laptop/ssd
|
||||
];
|
||||
|
||||
# Needed for wifi
|
||||
hardware.enableRedistributableFirmware = lib.mkDefault true;
|
||||
|
||||
# Cooling management
|
||||
services.thermald.enable = lib.mkDefault true;
|
||||
|
||||
# Allows for updating firmware via `fwupdmgr`.
|
||||
services.fwupd.enable = lib.mkDefault true;
|
||||
|
||||
# Enables ACPI platform profiles
|
||||
boot = lib.mkIf (lib.versionAtLeast pkgs.linux.version "6.1") {
|
||||
kernelModules = [ "hp-wmi" ];
|
||||
};
|
||||
|
||||
# reduces warnings/errors in boot log, seems to eliminate the ocassional boot hangs described in readme
|
||||
hardware.enableAllFirmware = lib.mkDefault true;
|
||||
}
|
|
@ -18,4 +18,14 @@ in
|
|||
|
||||
# √(2560² + 1600²) px / 16 in ≃ 189 dpi
|
||||
services.xserver.dpi = 189;
|
||||
|
||||
# Enable fingerprint reader
|
||||
services.fprintd = {
|
||||
enable = true;
|
||||
package = pkgs.fprintd-tod;
|
||||
tod = {
|
||||
enable = true;
|
||||
driver = pkgs.libfprint-2-tod1-elan;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
../.
|
||||
../../../common/cpu/intel/kaby-lake
|
||||
../../../common/pc/laptop/ssd
|
||||
];
|
||||
|
||||
# available cpufreq governors: performance powersave
|
||||
# The powersave mode locks the cpu to 700Mhz which is not really usable
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
||||
}
|
|
@ -7,14 +7,14 @@ let
|
|||
|
||||
cfg = config.microsoft-surface;
|
||||
|
||||
version = "6.8.6";
|
||||
version = "6.8.9";
|
||||
kernelPatches = surfacePatches {
|
||||
inherit version;
|
||||
patchFn = ./patches.nix;
|
||||
};
|
||||
kernelPackages = linuxPackage {
|
||||
inherit version kernelPatches;
|
||||
sha256 = "sha256-nnIyMtYDq0Xr8EPDRxTEjyd6sZXCmry4Ry8qTDpaGZU=";
|
||||
sha256 = "sha256-+QXxI46nqOhTFLrPKDMC6AlwBgENJfzqcm0N4OpbybY=";
|
||||
ignoreConfigErrors=true;
|
||||
};
|
||||
|
||||
|
|
|
@ -6,4 +6,8 @@
|
|||
boot.initrd.kernelModules = [
|
||||
"sdhci_pci" # 16G eMMC on board
|
||||
];
|
||||
|
||||
boot.kernelModules = [
|
||||
"it87" # ITE IT8786E Super IO Sensors
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,29 +1,9 @@
|
|||
{ lib
|
||||
, fetchFromGitHub
|
||||
, buildUBoot
|
||||
, buildPackages
|
||||
{ buildUBoot
|
||||
, opensbi
|
||||
}:
|
||||
|
||||
buildUBoot rec {
|
||||
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 = [ ];
|
||||
|
||||
buildUBoot {
|
||||
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"
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in New Issue