From fad336a2e8d70a1c04844e3bdfc347e9dec50728 Mon Sep 17 00:00:00 2001 From: gatkitty <126119280+gaykitty@users.noreply.github.com> Date: Thu, 25 Jan 2024 17:52:57 -0500 Subject: [PATCH] Add framework-laptop-kmod for framework laptops Whether this is enabled is an option as requested in #829 --- framework/13-inch/common/default.nix | 1 + framework/kmod.nix | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 framework/kmod.nix diff --git a/framework/13-inch/common/default.nix b/framework/13-inch/common/default.nix index c79061a..b7b961d 100644 --- a/framework/13-inch/common/default.nix +++ b/framework/13-inch/common/default.nix @@ -2,6 +2,7 @@ imports = [ ../../../common/pc/laptop ../../../common/pc/laptop/ssd + ../../kmod.nix ]; # Fix TRRS headphones missing a mic diff --git a/framework/kmod.nix b/framework/kmod.nix new file mode 100644 index 0000000..97a6f00 --- /dev/null +++ b/framework/kmod.nix @@ -0,0 +1,18 @@ +{ config, lib, ... }: +{ + options.hardware.framework.enableKmod = lib.mkOption { + type = lib.types.bool; + # Enable by default if on new enough version of NixOS + default = (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.05"); + description = '' + Enable the community created Framework kernel module that + allows interacting with the embedded controller from sysfs. + ''; + }; + + config = lib.mkIf options.hardware.framework.enableKmod { + boot.extraModulePackages = with config.boot.kernelPackages; [ + framework-laptop-kmod + ]; + }; +}