blob: 72296ed065f09112adc53ff0392efaa9da4f0a29 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.local.hardware.thinkpad;
in {
options.local.hardware.thinkpad = {
enable = mkEnableOption "Thinkpad hardware support";
};
config = mkIf cfg.enable {
# 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];
local = {
boot.impermanence.directories = [
{
directory = "/var/lib/fprint";
user = "root";
group = "root";
mode = "u=rwx,g=,o=";
}
];
hardware.laptop.enable = true;
};
services = {
fprintd.enable = true;
thinkfan.enable = true;
tlp.enable = true;
tp-auto-kbbl.enable = true;
};
};
}
|