modules/thinkpad: initial commit
This commit is contained in:
parent
4a7e6f545c
commit
a69723cf87
11
modules/thinkpad/default.nix
Normal file
11
modules/thinkpad/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
doctrine,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
doctrine.lib.mkModule {
|
||||||
|
inherit config;
|
||||||
|
name = "thinkpad";
|
||||||
|
sys = ./sys.nix;
|
||||||
|
requires = ["laptop"];
|
||||||
|
}
|
30
modules/thinkpad/sys.nix
Normal file
30
modules/thinkpad/sys.nix
Normal file
|
@ -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;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue