From babed36046f2260ff0fe17286827a3ab35b71cb3 Mon Sep 17 00:00:00 2001 From: caleb Date: Sat, 16 Nov 2024 18:20:31 -0500 Subject: [PATCH] added zephyrus g14 (2024) - ga403 --- README.md | 1 + asus/zephyrus/ga403/default.nix | 92 +++++++++++++++++++++++++++++++++ flake.nix | 1 + 3 files changed, 94 insertions(+) create mode 100644 asus/zephyrus/ga403/default.nix diff --git a/README.md b/README.md index a0b046553..143fe6a73 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,7 @@ See code for all available configurations. | [Asus ROG Zephyrus G14 GA402](asus/zephyrus/ga402) | `` | | [Asus ROG Zephyrus G14 GA402X\* (2023)](asus/zephyrus/ga402x/amdgpu) | `` | | [Asus ROG Zephyrus G14 GA402X\* (2023)](asus/zephyrus/ga402x/nvidia) | `` | +| [Asus ROG Zephyrus G14 GA403 (2024)](asus/zephyrus/ga403) | `` | | [Asus ROG Zephyrus G15 GA502](asus/zephyrus/ga502) | `` | | [Asus ROG Zephyrus G15 GA503](asus/zephyrus/ga503) | `` | | [Asus ROG Zephyrus G16 GU605MY](asus/zephyrus/gu605my) | `` | diff --git a/asus/zephyrus/ga403/default.nix b/asus/zephyrus/ga403/default.nix new file mode 100644 index 000000000..d3c36ff57 --- /dev/null +++ b/asus/zephyrus/ga403/default.nix @@ -0,0 +1,92 @@ +{ + config, + pkgs, + lib, + ... +}: + +let + inherit (lib) + mkDefault + mkForce + ; +in +{ + + imports = [ + ../../../common/cpu/amd + ../../../common/cpu/amd/pstate.nix + ../../../common/gpu/amd + ../../../common/pc/laptop + ../../../common/pc/laptop/acpi_call.nix + ../../../common/pc/ssd + ../../../common/gpu/nvidia/prime.nix + ../../../common/gpu/nvidia/ada-lovelace + ]; + + config = { + # Configure basic system settings: + boot = { + kernelPackages = mkDefault pkgs.linuxPackages_latest; + kernelModules = [ "kvm-amd" ]; + kernelParams = [ + "mem_sleep_default=deep" + "pcie_aspm.policy=powersupersave" + ]; + }; + + services = { + asusd = { + enable = mkDefault true; + enableUserService = mkDefault true; + }; + + supergfxd.enable = mkDefault true; + }; + + # Enable the Nvidia card, as well as Prime and Offload: NVIDIA GeForce RTX 4060 Mobile + boot.blacklistedKernelModules = [ "nouveau" ]; + + services.xserver.videoDrivers = mkForce [ + "amdgpu" + "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; + }; + }; + }; + # 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 = + lib.mkIf (config.networking.wireless.iwd.enable && config.networking.wireless.scanOnLowSignal) + { + General = { + RoamThreshold = -75; + RoamThreshold5G = -80; + RoamRetryInterval = 20; + }; + }; + }; +} diff --git a/flake.nix b/flake.nix index 44bedb0a0..446f5df0d 100644 --- a/flake.nix +++ b/flake.nix @@ -45,6 +45,7 @@ asus-zephyrus-ga402x = import ./asus/zephyrus/ga402x; asus-zephyrus-ga402x-amdgpu = import ./asus/zephyrus/ga402x/amdgpu; asus-zephyrus-ga402x-nvidia = import ./asus/zephyrus/ga402x/nvidia; + asus-zephyrus-ga403 = import ./asus/zephyrus/ga403; asus-zephyrus-ga502 = import ./asus/zephyrus/ga502; asus-zephyrus-ga503 = import ./asus/zephyrus/ga503; asus-zephyrus-gu603h = import ./asus/zephyrus/gu603h;