{ 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: Enable # 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.podman.enable; }; boot = { kernelParams = [ "pci=noaer" "i915.enable_dpcd_backlight=1" ]; kernelModules = [ "kvm-intel" ]; kernelPatches = [ { name = "alc285-fixup"; patch = ./gu605c-spi-cs-gpio/alc285-fixup.patch; } { name = "iwlwifi-no-disable-all-chans"; patch = ./iwlwifi/iwlwifi-no-disable-all-chans.patch; } ]; initrd = { prepend = [ "${import ./gu605c-spi-cs-gpio { inherit pkgs; }}/asus-gu605c-acpi.cpio" ]; kernelModules = [ "i915" "xhci_pci" "thunderbolt" "vmd" "nvme" "usbhid" "sd_mod" ]; }; }; nixpkgs.config.cudaSupport = 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.text = '' ( charge_control_end_threshold: 60, disable_nvidia_powerd_on_battery: true, ac_command: "", bat_command: "", platform_profile_linked_epp: true, platform_profile_on_battery: Quiet, change_platform_profile_on_battery: true, platform_profile_on_ac: Quiet, change_platform_profile_on_ac: true, profile_quiet_epp: Power, profile_balanced_epp: BalancePower, profile_custom_epp: Performance, profile_performance_epp: Performance, ac_profile_tunings: {}, dc_profile_tunings: {}, armoury_settings: {}, ) ''; }; supergfxd = { enable = true; settings = { vfio_enable = true; no_logind = true; }; }; }; environment.persistence."/persist/state"."/etc/asusd/aura_19b6.ron" = { }; home-manager.sharedModules = [ { wayland.windowManager.hyprland.settings.env = [ "AQ_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1" "__NV_PRIME_RENDER_OFFLOAD,1" "__VK_LAYER_NV_optimus,NVIDIA_only" "__GLX_VENDOR_LIBRARY_NAME,nvidia" ]; 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")" ''; } ) } &"; }; } ]; }