Unable to activate gamescope.capSysNice option

I am using gamescope via steam on my Nixos Unstable with hyprland.

I use gamescope to spoof the resolution in order to decrease the demand on my iGPU (RX 780M)

I activated gamescope this way:

        gamescope = {
          enable = true;
          args = [
            "-w 1620"
            "-h 1080"
            "-S stretch"

Then I modify the game launch options in steam and it works.

I would like to activate the CAP_SYS_NICE cap as gamescope complains about it.

No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.

So I tried to set to true the gamescope.capSysNice but when I try to start a game it does not start, and I can see the following in the logs:

failed to inherit capabilities: Operation not permittedUploaded AppInterfaceStats to Steam

Does anyone succeed in using this option?

I have the same problem.
In my earlier attempts to fix it somehow had bwrap complaining about unexpected capabilities but I’ve forgotten what I did.

After that I tried adding

security.wrappers."steam" = {
  setuid = true;
  owner = "root";
  group = "root";
  source = "${pkgs.steam}/bin/steam";

Which produced the error

bwrap: Creating new namespace failed: nesting depth or /proc/sys/user/max_*_namespaces exceeded (ENOSPC)

I checked the namespace limits and they seem plenty.
Looking through the source for programs.steam I saw that in the event gamescope.capSysNice is set it does setuid on bwrap, so tried doing that manually, but that changed nothing.
Tried gamescope capabilities manually, changing nothing. Tried gamescope setuid but that gave me Invalid MIT-MAGIC-COOKIE-1 key so I guess that upset xwayland or something.

Don’t really know what I’m doing, and now out of ideas.

Having the same problem. Does anyone have any solution?

Unfortunately no. I did not find any answers.

I’m also facing this issue.