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 + ]; + }; +}