From 21f5c1151d992a91b8641becfc302c8787d518bd Mon Sep 17 00:00:00 2001 From: LucasFA <23667494+LucasFA@users.noreply.github.com> Date: Mon, 6 Jan 2025 22:55:05 +0000 Subject: [PATCH] qc71_slimbook_laptop: init at 0-unstable-2024-12-18 Package fork of the qc71_laptop package for Slimbook laptop compatibility The difference between the packaging files is minimal. Beyond modifying the source, name, version and expected meta.*, also modify license to follow upstream: < license = licenses.gpl2Plus; --- > license = licenses.gpl2Only; --- .../manual/release-notes/rl-2505.section.md | 3 ++ .../001-fix-warning.patch | 12 ++++++ .../linux/qc71_slimbook_laptop/default.nix | 43 +++++++++++++++++++ pkgs/top-level/linux-kernels.nix | 2 + 4 files changed, 60 insertions(+) create mode 100644 pkgs/os-specific/linux/qc71_slimbook_laptop/001-fix-warning.patch create mode 100644 pkgs/os-specific/linux/qc71_slimbook_laptop/default.nix diff --git a/nixos/doc/manual/release-notes/rl-2505.section.md b/nixos/doc/manual/release-notes/rl-2505.section.md index 280b3ddb94883..7bed849c2a456 100644 --- a/nixos/doc/manual/release-notes/rl-2505.section.md +++ b/nixos/doc/manual/release-notes/rl-2505.section.md @@ -97,6 +97,9 @@ - [git-worktree-switcher](https://github.com/mateusauler/git-worktree-switcher), switch between git worktrees with speed. Available as [programs.git-worktree-switcher](#opt-programs.git-worktree-switcher.enable) + +- [qc71_slimbook_laptop](https://github.com/Slimbook-Team/qc71_laptop), a kernel module for Slimbook laptops. + ## Backward Incompatibilities {#sec-release-25.05-incompatibilities} diff --git a/pkgs/os-specific/linux/qc71_slimbook_laptop/001-fix-warning.patch b/pkgs/os-specific/linux/qc71_slimbook_laptop/001-fix-warning.patch new file mode 100644 index 0000000000000..8ff14a1573a96 --- /dev/null +++ b/pkgs/os-specific/linux/qc71_slimbook_laptop/001-fix-warning.patch @@ -0,0 +1,12 @@ +diff --git a/events.c b/events.c +--- a/events.c ++++ b/events.c +@@ -120,7 +120,7 @@ static void emit_keyboard_led_hw_changed(void) + up_read(&leds_list_lock); + } + #else +-static inline emit_keyboard_led_hw_changed(void) ++static inline void emit_keyboard_led_hw_changed(void) + { } + #endif + diff --git a/pkgs/os-specific/linux/qc71_slimbook_laptop/default.nix b/pkgs/os-specific/linux/qc71_slimbook_laptop/default.nix new file mode 100644 index 0000000000000..43ca6686a1670 --- /dev/null +++ b/pkgs/os-specific/linux/qc71_slimbook_laptop/default.nix @@ -0,0 +1,43 @@ +{ + lib, + stdenv, + fetchFromGitHub, + kernel, +}: + +stdenv.mkDerivation rec { + pname = "qc71_slimbook_laptop"; + version = "0-unstable-2024-12-18"; + + src = fetchFromGitHub { + owner = "Slimbook-Team"; + repo = "qc71_laptop"; + rev = "e130a03628dfc12105f4832ecf59f487f32bcdd7"; + hash = "sha256-xgGxkZyJ2UMgEweUfmSdvsnqwOyghafz2kxGeKCLqqg="; + }; + + patches = [ + ./001-fix-warning.patch + ]; + + nativeBuildInputs = kernel.moduleBuildDependencies; + + makeFlags = kernel.makeFlags ++ [ + "VERSION=${version}" + "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + ]; + + installPhase = '' + runHook preInstall + install -D qc71_laptop.ko -t $out/lib/modules/${kernel.modDirVersion}/extra + runHook postInstall + ''; + + meta = with lib; { + description = "Linux driver for QC71 laptop, with Slimbook patches"; + homepage = "https://github.com/Slimbook-Team/qc71_laptop/"; + license = licenses.gpl2Only; + maintainers = with maintainers; [ lucasfa ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix index 0eed40c970a8e..77d9ca0f420f5 100644 --- a/pkgs/top-level/linux-kernels.nix +++ b/pkgs/top-level/linux-kernels.nix @@ -601,6 +601,8 @@ in { qc71_laptop = callPackage ../os-specific/linux/qc71_laptop { }; + qc71_slimbook_laptop = callPackage ../os-specific/linux/qc71_slimbook_laptop { }; + hid-ite8291r3 = callPackage ../os-specific/linux/hid-ite8291r3 { }; hid-t150 = callPackage ../os-specific/linux/hid-t150 { };