mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-12-26 03:29:44 +01:00
Merge branch 'NixOS:master' into master
This commit is contained in:
commit
1a78f94968
8 changed files with 33 additions and 2062 deletions
|
@ -24,8 +24,6 @@ let
|
|||
|
||||
pipewirePackage = overrideAudioFiles pkgs.pipewire "spa/plugins/";
|
||||
|
||||
tiny-dfrPackage = pkgs.callPackage ./pkgs/tiny-dfr { };
|
||||
|
||||
apple-set-os-loader-installer = pkgs.stdenv.mkDerivation {
|
||||
name = "apple-set-os-loader-installer-1.0";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
|
@ -49,18 +47,18 @@ let
|
|||
|
||||
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 = {
|
||||
enableAppleSetOsLoader = lib.mkOption {
|
||||
default = false;
|
||||
type = lib.types.bool;
|
||||
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 [
|
||||
|
@ -108,33 +106,5 @@ in
|
|||
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";
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
|
@ -2,19 +2,19 @@
|
|||
, ... } @ args:
|
||||
|
||||
let
|
||||
version = "6.11.7";
|
||||
majorVersion = with lib; (elemAt (take 1 (splitVersion version)) 0);
|
||||
version = "6.12.4";
|
||||
majorVersion = lib.elemAt (lib.take 1 (lib.splitVersion version)) 0;
|
||||
|
||||
patchRepo = fetchFromGitHub {
|
||||
owner = "t2linux";
|
||||
repo = "linux-t2-patches";
|
||||
rev = "ec4545c603cf2ef315818eccce62d06ee18e5c60";
|
||||
hash = "sha256-Nm7WiLjotwk5NDrpKTgcKtyQTOUG7A88ZgtzD460qY0=";
|
||||
rev = "539eea1f9127f1623794ee8c7ccc37e8b00f60a3";
|
||||
hash = "sha256-pFeNOLTqnEupyEZDk+fX/5GFpobvN+L7Wv2K6V5Xx9g=";
|
||||
};
|
||||
|
||||
kernel = fetchzip {
|
||||
url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz";
|
||||
hash = "sha256-wHWd8xfEFOTy0FkFBtn30+6816XC4uhgn0G9b40n9Co=";
|
||||
hash = "sha256-SiQzaqraT/5s6Mown8/DeOWU7VR3IG0ojvkqThO09+0=";
|
||||
};
|
||||
in
|
||||
buildLinux (args // {
|
||||
|
@ -22,7 +22,7 @@ buildLinux (args // {
|
|||
|
||||
pname = "linux-t2";
|
||||
# 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" {} ''
|
||||
cp -r ${kernel} $out
|
||||
|
|
1933
apple/t2/pkgs/tiny-dfr/Cargo.lock
generated
1933
apple/t2/pkgs/tiny-dfr/Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -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 = [];
|
||||
};
|
||||
}
|
|
@ -8,7 +8,7 @@ in {
|
|||
./kernel
|
||||
];
|
||||
|
||||
microsoft-surface.kernelVersion = mkDefault "6.11";
|
||||
microsoft-surface.kernelVersion = mkDefault "6.12";
|
||||
|
||||
# Seems to be required to properly enable S0ix "Modern Standby":
|
||||
boot.kernelParams = mkDefault [ "mem_sleep_default=deep" ];
|
||||
|
|
|
@ -7,14 +7,14 @@ let
|
|||
|
||||
cfg = config.microsoft-surface;
|
||||
|
||||
version = "6.11.4";
|
||||
version = "6.12.4";
|
||||
kernelPatches = surfacePatches {
|
||||
inherit version;
|
||||
patchFn = ./patches.nix;
|
||||
};
|
||||
kernelPackages = linuxPackage {
|
||||
inherit version kernelPatches;
|
||||
sha256 = "0mcg1rrw9b0lwj88jkaw6ic2mks8xh8i92v90sbr2x35ljhb0m5x";
|
||||
sha256 = "sha256-bzX4IUM9hCG+cWeZB0fHxKDEUZWPuWiDRGMBrxPXEVI=";
|
||||
ignoreConfigErrors=true;
|
||||
};
|
||||
|
||||
|
|
|
@ -119,39 +119,35 @@ CONFIG_SURFACE_BOOK1_DGPU_SWITCH= module;
|
|||
patch = patchSrc + "/0006-ithc.patch";
|
||||
}
|
||||
{
|
||||
name = "ms-surface/0007-surface-sam";
|
||||
patch = patchSrc + "/0007-surface-sam.patch";
|
||||
name = "ms-surface/0007-surface-sam-over-hid";
|
||||
patch = patchSrc + "/0007-surface-sam-over-hid.patch";
|
||||
}
|
||||
{
|
||||
name = "ms-surface/0008-surface-sam-over-hid";
|
||||
patch = patchSrc + "/0008-surface-sam-over-hid.patch";
|
||||
name = "ms-surface/0008-surface-button";
|
||||
patch = patchSrc + "/0008-surface-button.patch";
|
||||
}
|
||||
{
|
||||
name = "ms-surface/0009-surface-button";
|
||||
patch = patchSrc + "/0009-surface-button.patch";
|
||||
name = "ms-surface/0009-surface-typecover";
|
||||
patch = patchSrc + "/0009-surface-typecover.patch";
|
||||
}
|
||||
{
|
||||
name = "ms-surface/0010-surface-typecover";
|
||||
patch = patchSrc + "/0010-surface-typecover.patch";
|
||||
name = "ms-surface/0010-surface-shutdown";
|
||||
patch = patchSrc + "/0010-surface-shutdown.patch";
|
||||
}
|
||||
{
|
||||
name = "ms-surface/0011-surface-shutdown";
|
||||
patch = patchSrc + "/0011-surface-shutdown.patch";
|
||||
name = "ms-surface/0011-surface-gpe";
|
||||
patch = patchSrc + "/0011-surface-gpe.patch";
|
||||
}
|
||||
{
|
||||
name = "ms-surface/0012-surface-gpe";
|
||||
patch = patchSrc + "/0012-surface-gpe.patch";
|
||||
name = "ms-surface/0012-cameras";
|
||||
patch = patchSrc + "/0012-cameras.patch";
|
||||
}
|
||||
{
|
||||
name = "ms-surface/0013-cameras";
|
||||
patch = patchSrc + "/0013-cameras.patch";
|
||||
name = "ms-surface/0013-amd-gpio";
|
||||
patch = patchSrc + "/0013-amd-gpio.patch";
|
||||
}
|
||||
{
|
||||
name = "ms-surface/0014-amd-gpio";
|
||||
patch = patchSrc + "/0014-amd-gpio.patch";
|
||||
}
|
||||
{
|
||||
name = "ms-surface/0015-rtc";
|
||||
patch = patchSrc + "/0015-rtc.patch";
|
||||
name = "ms-surface/0014-rtc";
|
||||
patch = patchSrc + "/0014-rtc.patch";
|
||||
}
|
||||
]
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
linux-surface = fetchFromGitHub {
|
||||
owner = "linux-surface";
|
||||
repo = "linux-surface";
|
||||
rev = "arch-6.11.4-1";
|
||||
hash = "sha256-5rKfAIkGoD5Y4nMobr7wGvzZqN2yFElXqHdcQS2VL14=";
|
||||
rev = "arch-6.12.4-1";
|
||||
hash = "sha256-RAcM28eheOJeHU8liC2lh0zpt/SqwOsHlpWuLmncXVc=";
|
||||
};
|
||||
|
||||
# This is the owner and repo for the pre-patched kernel from the "linux-surface" project:
|
||||
|
|
Loading…
Reference in a new issue