2024-04-07 21:31:18 +02:00
|
|
|
{ config, lib, ... }:
|
|
|
|
{
|
2024-07-29 23:37:28 +02:00
|
|
|
options.hardware.framework.enableKmod = lib.mkEnableOption
|
2024-04-07 21:31:18 +02:00
|
|
|
"Enable the community created Framework kernel module that allows interacting with the embedded controller from sysfs."
|
2024-07-29 23:37:28 +02:00
|
|
|
// {
|
2024-04-07 21:31:18 +02:00
|
|
|
# Enable by default if on new enough version of NixOS
|
|
|
|
default = (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.05");
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf config.hardware.framework.enableKmod {
|
|
|
|
boot.extraModulePackages = with config.boot.kernelPackages; [
|
|
|
|
framework-laptop-kmod
|
|
|
|
];
|
|
|
|
# https://github.com/DHowett/framework-laptop-kmod?tab=readme-ov-file#usage
|
|
|
|
boot.kernelModules = [ "cros_ec" "cros_ec_lpcs" ];
|
|
|
|
};
|
|
|
|
}
|