1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-11-23 11:29:42 +01:00

Reusing modules

This commit is contained in:
suliman 2022-12-28 23:10:35 +03:00
parent 485f3bc2f2
commit 2e8fce47c8

View file

@ -1,36 +1,24 @@
{ lib, pkgs, ... }: { lib, pkgs, ... }:
{ {
boot.initrd.kernelModules = [ imports = [
"amdgpu" ../../../thinkpad/yoga.nix
"ideapad_laptop" ../../../../common/gpu/amd/default.nix
]; ];
services.xserver.videoDrivers = [ "amdgpu" ];
boot.initrd.kernelModules = [ "ideapad_laptop" ];
hardware.opengl.extraPackages = with pkgs; [ hardware.opengl.extraPackages = with pkgs; [
rocm-opencl-icd
rocm-opencl-runtime
amdvlk
vaapiVdpau vaapiVdpau
libvdpau-va-gl libvdpau-va-gl
]; ];
hardware.opengl.extraPackages32 = with pkgs; [
driversi686Linux.amdvlk
];
hardware.opengl = {
driSupport = lib.mkDefault true;
driSupport32Bit = lib.mkDefault true;
};
environment.variables.AMD_VULKAN_ICD = lib.mkDefault "RADV";
# Latest Kernel # Latest Kernel
boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
# energy savings
hardware.bluetooth.powerOnBoot = lib.mkDefault false; hardware.bluetooth.powerOnBoot = lib.mkDefault false;
services.power-profiles-daemon.enable = false; services.power-profiles-daemon.enable = false;
services.tlp.enable = lib.mkDefault true; services.tlp.enable = lib.mkDefault true;
# automatic screen orientation, only works in X11
hardware.sensor.iio.enable = true;
# energy savings
boot.kernelParams = ["mem_sleep_default=deep" "pcie_aspm.policy=powersupersave"]; boot.kernelParams = ["mem_sleep_default=deep" "pcie_aspm.policy=powersupersave"];
powerManagement.enable = lib.mkDefault true; powerManagement.enable = lib.mkDefault true;
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";