nixos/hardware-configuration.nix

137 lines
3.9 KiB
Nix
Raw Normal View History

2024-05-02 17:21:25 -04:00
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
# let unstable = import <nixos-unstable> { config = { allowUnfree = true; }; };
# in
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
<nixos-hardware/lenovo/thinkpad/x1/7th-gen>
# <nixos-unstable/nixos/modules/services/hardware/thermald.nix>
];
# disabledModules = [ "services/hardware/thermald.nix" ];
boot.initrd.availableKernelModules =
[ "xhci_pci" "nvme" "usb_storage" "sd_mod" "thinkpad_acpi" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" "thinkpad_acpi" ];
boot.kernelPackages = pkgs.linuxPackages_latest;
#boot.kernelParams = [ "i915.force_probe=3ea0" "intel_pstate=disable" ];
boot.kernelParams = [ "i915.force_probe=3ea0" "intel_pstate=no_hwp" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/74437b9e-4505-4263-a688-1341827822a0";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/5D25-EACA";
fsType = "vfat";
};
swapDevices =
[{ device = "/dev/disk/by-uuid/e637bf0c-36dd-4bb0-8828-3b3eb2058909"; }];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
# hardware.enableAllFirmware = true;
nixpkgs.config.packageOverrides = pkgs: {
intel-vaapi-driver =
pkgs.intel-vaapi-driver.override { enableHybridCodec = true; };
};
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
services = {
#tlp = {
# enable = true;
# settings = {
# CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
# CPU_ENERGY_PERF_POLICY_ON_BAT = "powersave";
# CPU_SCALING_GOVERNOR_ON_AC = "performance";
# CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
# # CPU_MIN_PERF_ON_AC = 0;
# # CPU_MAX_PERF_ON_AC = 100;
# # CPU_MIN_PERF_ON_BAT = 0;
# # CPU_MAX_PERF_ON_BAT = 20;
# # Optional helps save long term battery health
# START_CHARGE_THRESH_BAT0 = 50; # 40 and bellow it starts to charge
# STOP_CHARGE_THRESH_BAT0 = 90; # 80 and above it stops charging
# };
#};
#upower.enable = true;
#thermald = {
# enable = true;
# ignoreCpuidCheck = true;
#};
#auto-cpufreq = {
# enable = true;
# settings = {
# battery = {
# governor = "conservative";
# turbo = "never";
# };
# charger = {
# governor = "performance";
# turbo = "auto";
# };
# };
#};
#undervolt = {
# enable = true;
# tempAc = 100;
# tempBat = 80;
# gpuOffset = -50;
# coreOffset = -50;
#};
fprintd = {
enable = true;
tod.enable = true;
tod.driver = pkgs.libfprint-2-tod1-goodix;
};
fwupd.enable = true;
#system76-scheduler = {
# enable = true;
# useStockConfig = true;
# settings.cfsProfiles.enable = true;
#};
power-profiles-daemon.enable = true;
};
#powerManagement = {
# enable = true;
# powertop.enable = true;
# # cpuFreqGovernor = "conservative";
#};
environment.sessionVariables = {
LIBVA_DRIVER_NAME = "iHD";
}; # Force intel-media-driver
}