1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-11-27 05:19:43 +01:00

fixed layout

This commit is contained in:
caleb 2024-11-16 18:43:28 -05:00
parent 51de9fe52b
commit ce8601a85a

View file

@ -5,7 +5,7 @@
}: }:
let let
inherit (lib) mkDefault; inherit (lib) mkDefault mkEnableOption mkIf mkMerge version versionAtLeast versionOlder;
in { in {
imports = [ imports = [
@ -19,71 +19,75 @@ in {
../../../../common/gpu/nvidia/ada-lovelace ../../../../common/gpu/nvidia/ada-lovelace
]; ];
# Configure basic system settings: config = mkMerge [
boot = { {
kernelPackages = mkDefault pkgs.linuxPackages_latest; # Configure basic system settings:
kernelModules = [ "kvm-amd" ]; boot = {
kernelParams = [ kernelPackages = mkDefault pkgs.linuxPackages_latest;
"mem_sleep_default=deep" kernelModules = [ "kvm-amd" ];
"pcie_aspm.policy=powersupersave" kernelParams = [
]; "mem_sleep_default=deep"
}; "pcie_aspm.policy=powersupersave"
];
services = {
asusd = {
enable = mkDefault true;
enableUserService = mkDefault true;
};
supergfxd.enable = mkDefault true;
};
(mkIf (versionOlder version "23.11") {
# See https://asus-linux.org/wiki/nixos/ for info about some problems
# detecting the dGPU:
systemd.services.supergfxd.path = [ pkgs.pciutils ];
})
(mkIf (config.networking.wireless.iwd.enable && config.networking.wireless.scanOnLowSignal) {
# Meditek doesn't seem to be quite sensitive enough on the default roaming settings:
# https://wiki.archlinux.org/title/Wpa_supplicant#Roaming
# https://wiki.archlinux.org/title/Iwd#iwd_keeps_roaming
#
# But NixOS doesn't have the tweaks for IWD, yet.
networking.wireless.iwd.settings = {
General = {
RoamThreshold = -75;
RoamThreshold5G = -80;
RoamRetryInterval = 20;
}; };
};
})
# Enable the Nvidia card, as well as Prime and Offload: NVIDIA GeForce RTX 4060 Mobile services = {
boot.blacklistedKernelModules = [ "nouveau" ]; asusd = {
services.xserver.videoDrivers = mkDefault [ "nvidia" ];
hardware = {
amdgpu.initrd.enable = mkDefault true;
nvidia = {
modesetting.enable = true;
nvidiaSettings = mkDefault true;
prime = {
offload = {
enable = mkDefault true; enable = mkDefault true;
enableOffloadCmd = mkDefault true; enableUserService = mkDefault true;
}; };
amdgpuBusId = "PCI:101:0:0";
nvidiaBusId = "PCI:1:0:0"; supergfxd.enable = mkDefault true;
}; };
powerManagement = { # Enable the Nvidia card, as well as Prime and Offload: NVIDIA GeForce RTX 4060 Mobile
enable = true; boot.blacklistedKernelModules = [ "nouveau" ];
finegrained = true
services.xserver.videoDrivers = mkDefault [ "nvidia" ];
hardware = {
amdgpu.initrd.enable = mkDefault true;
nvidia = {
modesetting.enable = true;
nvidiaSettings = mkDefault true;
prime = {
offload = {
enable = mkDefault true;
enableOffloadCmd = mkDefault true;
};
amdgpuBusId = "PCI:101:0:0";
nvidiaBusId = "PCI:1:0:0";
};
powerManagement = {
enable = true;
finegrained = true
};
};
}; };
}; }
};
(mkIf (versionOlder version "23.11") {
# See https://asus-linux.org/wiki/nixos/ for info about some problems
# detecting the dGPU:
systemd.services.supergfxd.path = [ pkgs.pciutils ];
})
(mkIf (config.networking.wireless.iwd.enable && config.networking.wireless.scanOnLowSignal) {
# Meditek doesn't seem to be quite sensitive enough on the default roaming settings:
# https://wiki.archlinux.org/title/Wpa_supplicant#Roaming
# https://wiki.archlinux.org/title/Iwd#iwd_keeps_roaming
#
# But NixOS doesn't have the tweaks for IWD, yet.
networking.wireless.iwd.settings = {
General = {
RoamThreshold = -75;
RoamThreshold5G = -80;
RoamRetryInterval = 20;
};
};
})
];
} }