[NVIDIA] Laptop powers down when (dis)connecting to wall-power when using powerManagement.finegrained = true

Hi! I have encountered a funky issue with my new Legion Slim 5 laptop, and do not really understand what could be happening.

My issue is a little simular to NVIDIA power saving misbehaving when disconnecting laptop from power, but different in the sense that my laptop just completely powers off when (dis)connecting from wall-power.

I have the following relevant configuration (PCIs are set somewhere else):

    # offload
    (mkIf (cfg.enable && cfg.mode == "offload") {

      hardware.nvidia.prime = {
        offload = {
          enable = true;
          enableOffloadCmd = true;
        };
      };

      # when disabling this line the issue does not appear!
      hardware.nvidia.powerManagement.finegrained = mkDefault true;

      # add a special boot entry NVIDIA Sync mode for gaming
      specialisation = {
        gaming.configuration = {
          programs.gamemode.enable = true;

          hardware.nvidia.powerManagement.finegrained = false;
          hardware.nvidia = {
            prime.sync.enable = lib.mkForce true;
            prime.offload = {
              enable = lib.mkForce false;
              enableOffloadCmd = lib.mkForce false;
            };
          };

        };
      };
    })

When in the GRUB menu the issue does not appear
When booted to my regular boot entry, so in offload mode, my the issue appears.
When I comment out the line containing finegrained = mkDefault true, the issue does not appear
When booted to the gaming specialization, so in sync mode the issue does not appear.

My conclusion: the issue is with enabling finegrained mode, which I would like to do in order to save some power.

What does finegrained = true do exactly, and can I fix this somehow?

[NixOS Search](https://info on nixos options)
[https://download.nvidia.com/XFree86/Linux-x86_64/435.17/README/dynamicpowermanagement.html](https://doc in question)

I dont know the exact answer , but I think for what i have read, that enables variable power consuption (maybe more and lower power comsuption states than normal, like variable cpufreq)

did you check
cat /sys/class/power_supply/*/capacity
for battery charge level?

I have that option enabled and mine is working correctly:

hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
powerManagement.finegrained = true;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.production;
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};

  	intelBusId = "PCI:0:2:0";
  	nvidiaBusId = "PCI:1:0:0";
  	};
  };