nixos/hardware/thinkpad-p1-gen3.nix

116 lines
2.8 KiB
Nix

{
config,
lib,
pkgs,
...
}: {
boot = {
initrd = {
availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"];
luks.devices."enc".device = "/dev/disk/by-uuid/1f1e51d6-3084-4f4d-9b4b-6caa0352f542";
};
kernelModules = ["kvm-intel" "acpi_call" "nvidia" "nvidia_modeset" "nvidia_umv" "nvidia_drm"];
extraModulePackages = with config.boot.kernelPackages; [acpi_call];
supportedFilesystems = ["btrfs"];
kernelParams = ["acpi_backlight=native"];
};
powerManagement = {
enable = true;
cpuFreqGovernor = "powersafe";
powertop.enable = true;
};
services.tlp = {
enable = true;
};
services.tp-auto-kbbl = {
enable = true;
device = "/dev/input/by-path/platform-i8042-serio-0-event-kbd";
};
services.upower.enable = true;
settings.nvidiaUsed = true;
hardware = {
# Enable bluetooth
bluetooth.enable = true;
nvidia.open = true;
nvidia.modesetting.enable = true;
# nvidia.dynamicBoost.enable = true;
nvidia.nvidiaSettings = true;
nvidia.powerManagement.enable = true;
nvidia.prime = {
offload.enable = true;
nvidiaBusId = "PCI:1:0:0";
intelBusId = "PCI:0:2:0";
};
graphics = {
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
nvidia-vaapi-driver
vaapiVdpau
libvdpau-va-gl
libva
];
};
trackpoint.enable = true;
trackpoint.emulateWheel = lib.mkDefault config.hardware.trackpoint.enable;
};
services.xserver.videoDrivers = ["nvidia"];
nixpkgs.config.packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;};
};
services.hardware.bolt.enable = true;
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/d9fd201a-f9f5-4d6f-9706-cc698699704d";
fsType = "btrfs";
options = ["subvol=root" "compress=zstd"];
};
"/boot" = {
device = "/dev/disk/by-uuid/B767-2B7C";
fsType = "vfat";
};
"/home" = {
device = "/dev/disk/by-uuid/d9fd201a-f9f5-4d6f-9706-cc698699704d";
fsType = "btrfs";
options = ["subvol=home" "compress=zstd"];
};
"/nix" = {
device = "/dev/disk/by-uuid/d9fd201a-f9f5-4d6f-9706-cc698699704d";
fsType = "btrfs";
options = ["subvol=nix" "compress=zstd"];
};
"/persist" = {
device = "/dev/disk/by-uuid/d9fd201a-f9f5-4d6f-9706-cc698699704d";
fsType = "btrfs";
options = ["subvol=persist" "compress=zstd"];
};
"/var/log" = {
device = "/dev/disk/by-uuid/d9fd201a-f9f5-4d6f-9706-cc698699704d";
fsType = "btrfs";
options = ["subvol=log" "compress=zstd"];
neededForBoot = true;
};
};
swapDevices = [{device = "/dev/disk/by-uuid/6948f567-03b3-4a38-b3c4-e05e0bbfbf55";}];
}