1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-12-26 19:49:45 +01:00

Merge branch 'NixOS:master' into master

This commit is contained in:
cgrohs20 2024-12-16 13:56:27 +00:00 committed by GitHub
commit 1a78f94968
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 33 additions and 2062 deletions

View file

@ -24,8 +24,6 @@ let
pipewirePackage = overrideAudioFiles pkgs.pipewire "spa/plugins/"; pipewirePackage = overrideAudioFiles pkgs.pipewire "spa/plugins/";
tiny-dfrPackage = pkgs.callPackage ./pkgs/tiny-dfr { };
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 {
@ -49,18 +47,18 @@ let
in in
{ {
imports = [
(lib.mkRemovedOptionModule ["hardware" "apple-t2" "enableTinyDfr"] ''
The hardware.apple-t2.enableTinyDfr option was deprecated and removed since upstream Nixpkgs now has an identical module.
Please migrate to hardware.apple.touchBar.
'')
];
options.hardware.apple-t2 = { options.hardware.apple-t2 = {
enableAppleSetOsLoader = lib.mkOption { enableAppleSetOsLoader = lib.mkOption {
default = false; default = false;
type = lib.types.bool; type = lib.types.bool;
description = "Whether to enable the appleSetOsLoader activation script."; description = "Whether to enable the appleSetOsLoader activation script.";
}; };
enableTinyDfr = lib.mkOption {
default = true;
type = lib.types.bool;
description = "Whether to enable the tiny-dfr touchbar service.";
};
}; };
config = lib.mkMerge [ config = lib.mkMerge [
@ -108,33 +106,5 @@ in
options apple-gmux force_igd=y options apple-gmux force_igd=y
''; '';
}) })
(lib.mkIf t2Cfg.enableTinyDfr {
warnings = [
''
hardware.apple-t2.enableTinyDfr is deprecated since the module has been upstreamed as hardware.apple.touchBar.
This option will be removed from the apple/t2 profile when NixOS 24.11 is released.
''
];
assertions = lib.optionals (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.11") [{
assertion = !config.hardware.apple.touchBar.enable;
message = "hardware.apple-t2.enableTinyDfr conflicts with hardware.apple.touchBar.enable. Please disable one of them.";
}];
services.udev.packages = [ tiny-dfrPackage ];
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";
};
})
]; ];
} }

View file

@ -2,19 +2,19 @@
, ... } @ args: , ... } @ args:
let let
version = "6.11.7"; version = "6.12.4";
majorVersion = with lib; (elemAt (take 1 (splitVersion version)) 0); majorVersion = lib.elemAt (lib.take 1 (lib.splitVersion version)) 0;
patchRepo = fetchFromGitHub { patchRepo = fetchFromGitHub {
owner = "t2linux"; owner = "t2linux";
repo = "linux-t2-patches"; repo = "linux-t2-patches";
rev = "ec4545c603cf2ef315818eccce62d06ee18e5c60"; rev = "539eea1f9127f1623794ee8c7ccc37e8b00f60a3";
hash = "sha256-Nm7WiLjotwk5NDrpKTgcKtyQTOUG7A88ZgtzD460qY0="; hash = "sha256-pFeNOLTqnEupyEZDk+fX/5GFpobvN+L7Wv2K6V5Xx9g=";
}; };
kernel = fetchzip { kernel = 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-wHWd8xfEFOTy0FkFBtn30+6816XC4uhgn0G9b40n9Co="; hash = "sha256-SiQzaqraT/5s6Mown8/DeOWU7VR3IG0ojvkqThO09+0=";
}; };
in in
buildLinux (args // { buildLinux (args // {
@ -22,7 +22,7 @@ buildLinux (args // {
pname = "linux-t2"; pname = "linux-t2";
# Snippet from nixpkgs # Snippet from nixpkgs
modDirVersion = with lib; "${concatStringsSep "." (take 3 (splitVersion "${version}.0"))}"; modDirVersion = "${lib.concatStringsSep "." (lib.take 3 (lib.splitVersion "${version}.0"))}";
src = runCommand "patched-source" {} '' src = runCommand "patched-source" {} ''
cp -r ${kernel} $out cp -r ${kernel} $out

File diff suppressed because it is too large Load diff

View file

@ -1,62 +0,0 @@
{
lib,
rustPlatform,
fetchFromGitHub,
pkg-config,
cairo,
gdk-pixbuf,
glib,
libinput,
libxml2,
pango,
udev,
}:
let
src = fetchFromGitHub {
owner = "kekrby";
repo = "tiny-dfr";
rev = "8a5d413cb1dbe2a25b77a9e7f3cb5b9c88ef3ffb";
hash = "sha256-l4D7aePz/CYpkRorrvsgIYrvSzoZl59OGcFGJqqJftk=";
};
in rustPlatform.buildRustPackage {
pname = "tiny-dfr";
version = src.rev;
inherit src;
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = [
pkg-config
];
buildInputs = [
udev
glib
pango
cairo
gdk-pixbuf
libxml2
libinput
];
postPatch = ''
substituteInPlace src/main.rs \
--replace-fail "/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 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 = [];
};
}

View file

@ -8,7 +8,7 @@ in {
./kernel ./kernel
]; ];
microsoft-surface.kernelVersion = mkDefault "6.11"; microsoft-surface.kernelVersion = mkDefault "6.12";
# Seems to be required to properly enable S0ix "Modern Standby": # Seems to be required to properly enable S0ix "Modern Standby":
boot.kernelParams = mkDefault [ "mem_sleep_default=deep" ]; boot.kernelParams = mkDefault [ "mem_sleep_default=deep" ];

View file

@ -7,14 +7,14 @@ let
cfg = config.microsoft-surface; cfg = config.microsoft-surface;
version = "6.11.4"; version = "6.12.4";
kernelPatches = surfacePatches { kernelPatches = surfacePatches {
inherit version; inherit version;
patchFn = ./patches.nix; patchFn = ./patches.nix;
}; };
kernelPackages = linuxPackage { kernelPackages = linuxPackage {
inherit version kernelPatches; inherit version kernelPatches;
sha256 = "0mcg1rrw9b0lwj88jkaw6ic2mks8xh8i92v90sbr2x35ljhb0m5x"; sha256 = "sha256-bzX4IUM9hCG+cWeZB0fHxKDEUZWPuWiDRGMBrxPXEVI=";
ignoreConfigErrors=true; ignoreConfigErrors=true;
}; };

View file

@ -119,39 +119,35 @@ CONFIG_SURFACE_BOOK1_DGPU_SWITCH= module;
patch = patchSrc + "/0006-ithc.patch"; patch = patchSrc + "/0006-ithc.patch";
} }
{ {
name = "ms-surface/0007-surface-sam"; name = "ms-surface/0007-surface-sam-over-hid";
patch = patchSrc + "/0007-surface-sam.patch"; patch = patchSrc + "/0007-surface-sam-over-hid.patch";
} }
{ {
name = "ms-surface/0008-surface-sam-over-hid"; name = "ms-surface/0008-surface-button";
patch = patchSrc + "/0008-surface-sam-over-hid.patch"; patch = patchSrc + "/0008-surface-button.patch";
} }
{ {
name = "ms-surface/0009-surface-button"; name = "ms-surface/0009-surface-typecover";
patch = patchSrc + "/0009-surface-button.patch"; patch = patchSrc + "/0009-surface-typecover.patch";
} }
{ {
name = "ms-surface/0010-surface-typecover"; name = "ms-surface/0010-surface-shutdown";
patch = patchSrc + "/0010-surface-typecover.patch"; patch = patchSrc + "/0010-surface-shutdown.patch";
} }
{ {
name = "ms-surface/0011-surface-shutdown"; name = "ms-surface/0011-surface-gpe";
patch = patchSrc + "/0011-surface-shutdown.patch"; patch = patchSrc + "/0011-surface-gpe.patch";
} }
{ {
name = "ms-surface/0012-surface-gpe"; name = "ms-surface/0012-cameras";
patch = patchSrc + "/0012-surface-gpe.patch"; patch = patchSrc + "/0012-cameras.patch";
} }
{ {
name = "ms-surface/0013-cameras"; name = "ms-surface/0013-amd-gpio";
patch = patchSrc + "/0013-cameras.patch"; patch = patchSrc + "/0013-amd-gpio.patch";
} }
{ {
name = "ms-surface/0014-amd-gpio"; name = "ms-surface/0014-rtc";
patch = patchSrc + "/0014-amd-gpio.patch"; patch = patchSrc + "/0014-rtc.patch";
}
{
name = "ms-surface/0015-rtc";
patch = patchSrc + "/0015-rtc.patch";
} }
] ]

View file

@ -4,8 +4,8 @@
linux-surface = fetchFromGitHub { linux-surface = fetchFromGitHub {
owner = "linux-surface"; owner = "linux-surface";
repo = "linux-surface"; repo = "linux-surface";
rev = "arch-6.11.4-1"; rev = "arch-6.12.4-1";
hash = "sha256-5rKfAIkGoD5Y4nMobr7wGvzZqN2yFElXqHdcQS2VL14="; hash = "sha256-RAcM28eheOJeHU8liC2lh0zpt/SqwOsHlpWuLmncXVc=";
}; };
# This is the owner and repo for the pre-patched kernel from the "linux-surface" project: # This is the owner and repo for the pre-patched kernel from the "linux-surface" project: