Files
nix/hosts/himalia/hardware/default.nix
Nikolaos Karaolidis b631d466ff Add asusctl settings
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
2025-05-25 21:18:28 +01:00

127 lines
2.6 KiB
Nix

{
config,
pkgs,
lib,
...
}:
{
imports = [
./display.nix
./keybinds.nix
];
hardware = {
enableAllFirmware = true;
cpu = {
cores = 16;
threads = 16;
intel.updateMicrocode = true;
};
nvidia = {
open = true;
powerManagement.enable = true;
# TODO
# dynamicBoost.enable = true;
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
};
graphics = {
enable32Bit = true;
extraPackages = with pkgs; [
vaapiVdpau
intel-vaapi-driver
libvdpau-va-gl
intel-media-driver
];
};
nvidia-container-toolkit.enable = (
config.virtualisation.containerd.enable
|| config.virtualisation.docker.enable
|| config.virtualisation.podman.enable
);
};
boot = {
kernelParams = [ "pci=noaer" ];
kernelModules = [ "kvm-intel" ];
initrd.kernelModules = [
"i915"
"xhci_pci"
"thunderbolt"
"vmd"
"nvme"
"usbhid"
"sd_mod"
];
};
nixpkgs.config.cudaSupport = true;
powerManagement.enable = true;
services = {
xserver.videoDrivers = [ "nvidia" ];
fstrim.enable = true;
tlp.settings.DISK_DEVICES = lib.mkDefault "nvme0n1 nvme1n1";
asusd = {
enable = true;
# FIXME: https://gitlab.com/asus-linux/asusctl/-/issues/532
# enableUserService = true;
asusdConfig.source = ./asusd.ron;
};
supergfxd = {
enable = true;
settings = {
vfio_enable = true;
no_logind = true;
};
};
};
environment.persistence."/persist"."/etc/asusd/aura_19b6.ron" = { };
programs.gamescope.env = {
__NV_PRIME_RENDER_OFFLOAD = "1";
__VK_LAYER_NV_optimus = "NVIDIA_only";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
};
home-manager.sharedModules = [
{
wayland.windowManager.hyprland.settings.env = [
"AQ_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1"
];
theme = {
template.".config/asusctl/keyboard".source =
pkgs.writeText ".config/asusctl/keyboard" "{{colors.primary_container.default.hex_stripped}}";
initExtraConfig = "${
lib.meta.getExe (
pkgs.writeShellApplication {
name = "theme-asusctl";
runtimeInputs = with pkgs; [ asusctl ];
text = ''
asusctl aura static -c "$(<"$HOME/.config/asusctl/keyboard")"
'';
}
)
} &";
};
}
];
}