From d946893c3b99dab02f97dbde49d3c62223d4ef68 Mon Sep 17 00:00:00 2001 From: Andy3153 Date: Mon, 20 May 2024 00:55:37 +0300 Subject: [PATCH] add config for ASUS TUF FX506HM --- README.md | 1 + asus/fx506hm/README.md | 28 ++++++++++++++++++++++++++++ asus/fx506hm/default.nix | 24 ++++++++++++++++++++++++ flake.nix | 1 + 4 files changed, 54 insertions(+) create mode 100644 asus/fx506hm/README.md create mode 100644 asus/fx506hm/default.nix diff --git a/README.md b/README.md index d3ca5c8..23ebd3b 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,7 @@ See code for all available configurations. | [Asus ROG Zephyrus G15 GA503](asus/zephyrus/ga503) | `` | | [Asus ROG Zephyrus M16 GU603H](asus/zephyrus/gu603h) | `` | | [Asus TUF FX504GD](asus/fx504gd) | `` | +| [Asus TUF FX506HM](asus/fx506hm) | `` | | [Asus TUF FA507RM](asus/fa507rm) | `` | | [Asus TUF FA507NV](asus/fa507nv) | `` | | [BeagleBoard PocketBeagle](beagleboard/pocketbeagle) | `` | diff --git a/asus/fx506hm/README.md b/asus/fx506hm/README.md new file mode 100644 index 0000000..d20ee88 --- /dev/null +++ b/asus/fx506hm/README.md @@ -0,0 +1,28 @@ + +# [ASUS TUF Gaming F15 FX506HM (2021)](https://www.asus.com/laptops/for-gaming/tuf-gaming/2021-asus-tuf-gaming-f15/) + +This imports common modules for the Intel CPU and iGPU, Nvidia and PRIME render offloading, basic laptop configs, basic SSD configs and configs for ASUS batteries. + +On top of that, it sets the right PCI bus IDs for the iGPU and dGPU to make PRIME work well and enables modesetting. + +## Useful other things to consider in your configuration +### Battery charging limit +Due to the common module for ASUS batteries, you can make your battery only charge up to a certain percentage to improve its life. You can place something similar to the following in your configuration to enable it: + +```nix +hardware.asus.battery = +{ + chargeUpto = 85; # Maximum level of charge for your battery, as a percentage. + enableChargeUptoScript = true; # Whether to add charge-upto to environment.systemPackages. `charge-upto 85` temporarily sets the charge limit to 85%. +}; +``` + +### OpenRGB +You can use OpenRGB to control the RGB keyboard on this laptop. There's also plugins for it to get some extra RGB lighting modes if you wish. You can place the following in your configuration to enable it: + +```nix +boot.kernelModules = [ "i2c-dev" ]; +hardware.i2c.enable = true; +services.udev.packages = [ pkgs.openrgb ]; +services.hardware.openrgb.enable = true; +``` diff --git a/asus/fx506hm/default.nix b/asus/fx506hm/default.nix new file mode 100644 index 0000000..90b32cf --- /dev/null +++ b/asus/fx506hm/default.nix @@ -0,0 +1,24 @@ +{ lib, ... }: + +{ + imports = + [ + ../../common/cpu/intel + ../../common/gpu/nvidia + ../../common/gpu/nvidia/prime.nix + ../../common/pc/laptop + ../../common/pc/ssd + ../battery.nix + ] + + hardware.nvidia = + { + modesetting.enable = lib.mkDefault true; + + prime = + { + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; + }; +} diff --git a/flake.nix b/flake.nix index 58621d7..243485b 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,7 @@ asus-battery = import ./asus/battery.nix; asus-ally-rc71l = import ./asus/ally/rc71l; asus-fx504gd = import ./asus/fx504gd; + asus-fx506hm = import ./asus/fx506hm; asus-fa507nv = import ./asus/fa507nv; asus-fa507rm = import ./asus/fa507rm; asus-pro-ws-x570-ace = import ./asus/pro-ws-x570-ace;