Asus Zehpyrus g16 backlight and asus rog app config

Hey nixos peeps I’m rather new to nixos but I really love the philosophy behind it. I have a few questions regarding screen backlight and other optimization tweaks.

  1. I can’t for the love of nixos figure out how to make it so I can tweak the brightness of my screen… Does anyone know how to do this on a hybrid intel/nvidia laptop?I have an RTX4070
  2. I have the asus rog app installed but I’m missing the asus-armory driver which allows me to tweak the power settings of my CPU and GPU. Anyone know how to solve that one?
  3. Lastly, any performance tweaks I can make to save some battery life? That would be super useful!

Thanks !

So this what I currently have to make those work (I’m on unstable):

  # display backlight for g16 
  boot.kernelParams = [
    "i915.enable_dpcd_backlight=1" 
    "nvidia.NVreg_EnableBacklightHandler=0"
  ];

  # Asus Armory kernel module
  boot.kernelPackages = pkgs.linuxPackages_latest;
  # Asus kernel patches
  boot.kernelPatches = let
      version = config.boot.kernelPackages.kernel.version;
  in [
    {
      name = "g14";
      patch = builtins.fetchurl {
        # url = "https://gitlab.com/dragonn/linux-g14/-/raw/${lib.versions.majorMinor version}/asus-patch-series.patch";
        url = "https://gitlab.com/asus-linux/fedora-kernel/-/raw/rog-${lib.versions.majorMinor version}/asus-patch-series.patch";
      };
      extraStructuredConfig = with lib.kernel; {
        ASUS_ARMOURY = module;
        # ASUS_WMI_BIOS = yes;
      };
      extraMeta = {
        branch = lib.versions.majorMinor version;
      };
    }
  ];

I don’t know if the 6.14 kernel fixes the backlight thing or not but this still works for me so I’ve kept it until I can look into it.

I don’t think nix will keep custom hardware patches so we have to add them ourselves, which means we get to build the kernel every time there’s a new version but c’est la vie-- my solution isn’t perfect because sometimes a new kernel branch will happen and the asus-linux kernel repo won’t have a branch for it yet, etc. but you’ll kinda know because your build will blow up during the kernel build. If there’s a better way to do this I’m all ears!

1 Like

Is the dedicated repo for hardware quirks. You can contribute yours there.

Thank you for this!! I have one more question

Recently noticed that my laptop completely freezes up when I have an external monitor plugged in (not sure if that matters). Is this something you’ve experienced even with the latest closed source drivers ?

Yeah these changes weren’t in this GitHub repo so it didn’t work for me. They also use the latest open source drivers which is causing 40 series cards to freeze up …

I do use nixos-hardware, I forgot to state that, these things were ones I had to figure out on top of it. And I think both these I found/cobbled together from surfing the open issues where the repo hadn’t come down on a decision yet. I don’t think there’s anything I’m doing that’s not already being deliberated over there. But I DID need my hardware to work.

I don’t use an external monitor so I haven’t encountered that but it’s very possible I would if I did. I wish I could be of more help here! I usually just start searching around for people in the discourse here who have a similar problem, or look at the nixpgks issues or other forums where people have the same problem and try and translate the solution to nix config.

Ahh okay well I hope someone figures out the whole monitor glitching out. It doesn’t happen if I don’t use an external monitor