blob: 2a8a9de4ff6ef131b3bd6ec0a0fdd3c73444403e (
plain) (
blame)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
{ config, lib, pkgs, modulesPath, ... }:
let
nixos-hardware = builtins.fetchGit { url = "https://github.com/NixOS/nixos-hardware.git"; };
in {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
"${nixos-hardware}/lenovo/thinkpad/e14/intel"
];
# services.fwupd.enable = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.initrd = {
availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usb_storage"
"thunderbolt"
"sd_mod"
];
kernelModules = [ "i915" ];
};
boot.kernelModules = [
"kvm-intel"
"rtw88_8822ce"
"sd_mod"
"snd-seq"
"snd-rawmidi"
"uinput"
"v4l2loopback"
"acpi_call"
"thinkpad_acpi"
"coretemp"
];
boot.extraModulePackages = with config.boot.kernelPackages; [
acpi_call
v4l2loopback
];
boot.kernelParams = [
"i8042.nopnp=1"
"pci=nocrs"
"acpi_osi=linux"
"acpi_backlight=native"
"i915.enable_dpcd_backlight=0"
"i915.enable_guc=2"
"i915.enable_psr=0"
"i915.enable_dc=0"
# "nomodeset"
# "i915.modeset=0"
# "acpi_backlight=vendor"
# "acpi_backlight=intel_backlight"
# "i915.force_probe=46a8"
];
boot.extraModprobeConfig = ''
options snd slots=snd-hda-intel
options v4l2loopback exclusive_caps=1 card_label="Virtual Camera"
options thinkpad_acpi experimental=1 fan_control=1
'';
boot.supportedFilesystems = [ "ntfs" ];
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
services.throttled.enable = true;
services.thermald = {
enable = true;
ignoreCpuidCheck = true;
};
services.udev = {
packages = with pkgs; [
# alsa-utils
# (alsa-utils.overrideAttrs (self: {
# postFixup = ''
# ${self.postFixup}
#
# cat $out/lib/udev/rules.d/*
# '';
# }))
# android-udev-rules
platformio-core.udev
openocd
zsa-udev-rules
logitech-udev-rules
qmk-udev-rules
];
};
environment.systemPackages = with pkgs; [
mesa
xf86inputlibinput
# xf86videointel
];
services.xserver.videoDrivers = [ "modesetting" ];
hardware = {
enableAllFirmware = true;
cpu.intel.updateMicrocode = true;
};
nixpkgs.config.packageOverrides = pkgs: {
intel-vaapi-driver = pkgs.intel-vaapi-driver.override { enableHybridCodec = true; };
};
hardware.graphics = {
enable = true;
# enable32Bit = true;
# driSupport = true;
# driSupport32Bit = true;
extraPackages = with pkgs; [
intel-media-driver
# intel-vaapi-driver
intel-vaapi-driver
libva-vdpau-driver
libvdpau-va-gl
intel-gmmlib
vulkan-tools
mesa
];
};
environment.variables = {
VDPAU_DRIVER = "va_gl";
LIBVA_DRIVER_NAME = "iHD";
};
# Bootloader
boot.loader = {
systemd-boot = {
enable = true;
configurationLimit = 30;
};
timeout = 1;
efi.canTouchEfiVariables = true;
};
# File system
boot.initrd.luks.devices."crypted".device = "/dev/disk/by-uuid/17ac9757-d710-4456-9a94-7b6086a35638";
fileSystems = {
"/" = {
device = "/dev/mapper/crypted";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
};
swapDevices = [{ device = "/dev/disk/by-label/swap"; }];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
networking.useDHCP = lib.mkDefault true;
powerManagement = {
enable = false;
cpuFreqGovernor = "powersave";
};
services.tlp.enable = false;
}
|