From 6d499a262d2a26db1dab7d9c77fa135566e2b18b Mon Sep 17 00:00:00 2001 From: gaykitty <126119280+gaykitty@users.noreply.github.com> Date: Mon, 4 Dec 2023 14:59:33 -0500 Subject: [PATCH] framework-laptop-kmod: init at unstable-2023-12-03 --- .../linux/framework-laptop-kmod/default.nix | 38 +++++++++++++++++++ pkgs/top-level/linux-kernels.nix | 2 + 2 files changed, 40 insertions(+) create mode 100644 pkgs/os-specific/linux/framework-laptop-kmod/default.nix diff --git a/pkgs/os-specific/linux/framework-laptop-kmod/default.nix b/pkgs/os-specific/linux/framework-laptop-kmod/default.nix new file mode 100644 index 000000000000..088e30e91f8c --- /dev/null +++ b/pkgs/os-specific/linux/framework-laptop-kmod/default.nix @@ -0,0 +1,38 @@ +{ lib +, stdenv +, linuxPackages +, kernel +, fetchFromGitHub +}: + +stdenv.mkDerivation rec { + pname = "framework-laptop-kmod"; + version = "unstable-2023-12-03"; + + src = fetchFromGitHub { + owner = "DHowett"; + repo = "framework-laptop-kmod"; + rev = "d5367eb9e5b5542407494d04ac1a0e77f10cc89d"; + hash = "sha256-t8F4XHPkuCjWBrsEjW97ielYtf3V6hlLsrasvyab198="; + }; + + nativeBuildInputs = kernel.moduleBuildDependencies; + + makeFlags = kernel.makeFlags ++ [ + "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + ]; + + installPhase = '' + runHook preInstall + install -D framework_laptop.ko -t $out/lib/modules/${kernel.modDirVersion}/extra + runHook postInstall + ''; + + meta = with lib; { + description = "A kernel module that exposes the Framework Laptop (13, 16)'s battery charge limit and LEDs to userspace."; + homepage = "https://github.com/DHowett/framework-laptop-kmod"; + license = licenses.gpl2; + maintainers = with maintainers; [ gaykitty ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix index d796fa7164d0..4319affc1032 100644 --- a/pkgs/top-level/linux-kernels.nix +++ b/pkgs/top-level/linux-kernels.nix @@ -341,6 +341,8 @@ in { fanout = callPackage ../os-specific/linux/fanout { }; + framework-laptop-kmod = callPackage ../os-specific/linux/framework-laptop-kmod { }; + fwts-efi-runtime = callPackage ../os-specific/linux/fwts/module.nix { }; gcadapter-oc-kmod = callPackage ../os-specific/linux/gcadapter-oc-kmod { };