summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2025-08-06 14:25:43 -0600
committerAlejandro Soto <alejandro@34project.org>2025-08-06 14:37:49 -0600
commitf58ff94bfce386be7b9919c6f9189e6b40bcb7f9 (patch)
tree1a8bbdd65342a553ee1c1ba7dbd139b03fa09375 /modules
parenteac01c5726efd218349b11834e1aab344158ee02 (diff)
modules/thinkpad: initial commit
Diffstat (limited to 'modules')
-rw-r--r--modules/thinkpad/default.nix11
-rw-r--r--modules/thinkpad/sys.nix30
2 files changed, 41 insertions, 0 deletions
diff --git a/modules/thinkpad/default.nix b/modules/thinkpad/default.nix
new file mode 100644
index 0000000..e210947
--- /dev/null
+++ b/modules/thinkpad/default.nix
@@ -0,0 +1,11 @@
+{
+ config,
+ doctrine,
+ ...
+}:
+doctrine.lib.mkModule {
+ inherit config;
+ name = "thinkpad";
+ sys = ./sys.nix;
+ requires = ["laptop"];
+}
diff --git a/modules/thinkpad/sys.nix b/modules/thinkpad/sys.nix
new file mode 100644
index 0000000..bc96146
--- /dev/null
+++ b/modules/thinkpad/sys.nix
@@ -0,0 +1,30 @@
+{
+ config,
+ pkgs,
+ lib,
+ ...
+}: {
+ # For suspending to RAM to work, set Config -> Power -> Sleep State to "Linux" in EFI.
+ # See https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Carbon_(Gen_6)#Suspend_issues
+ # Fingerprint sensor requires a firmware-update to work.
+
+ boot = {
+ extraModulePackages = with config.boot.kernelPackages; [acpi_call];
+ extraModprobeConfig = "options iwlwifi 11n_disable=1 wd_disable=1";
+
+ # acpi_call makes tlp work for newer thinkpads
+ kernelModules = ["acpi_call"];
+
+ # Force use of the thinkpad_acpi driver for backlight control.
+ # This allows the backlight save/load systemd service to work.
+ kernelParams = ["acpi_backlight=native"];
+ };
+
+ hardware.firmware = [pkgs.sof-firmware];
+
+ services = {
+ fprintd.enable = lib.mkDefault true;
+ thinkfan.enable = lib.mkDefault true;
+ tp-auto-kbbl.enable = lib.mkDefault true;
+ };
+}