Sunshine self-hosted game stream

That helped some, I got a bit closer. Steam won’t start, but I am generating the configs via home-manager.

I got resolution switching working, but it seems steam won’t open due to a permissions error most likely…

Error from steam.txt

bwrap: Unexpected capabilities but not setuid, old file caps config?

Sunshine log:

[2023:06:21:16:07:33]: Info: Spawning [/nix/store/87mfa22rgff50l6fafclzkhy9b9s0b0a-util-linux-2.38.1-bin/bin/setsid /nix/store/jx6aiqgwvxp6kmxhwrl4ipg9971m8q8w-steam/bin/steam steam://open/bigpicture] in ["/nix/store/87mfa22rgff50l6fafclzkhy9b9s0b0a-util-linux-2.38.1-bin/bin"]
[2023:06:21:16:07:33]: Warning: run_unprivileged() is not yet implemented for this platform. The new process will run with Sunshine's permissions.

Edit: Here is the home-manager config:

home-manager.users.<username> = { pkgs, ... }: {  
    home.stateVersion = "23.05";  
    home.packages = [pkgs.libreoffice];
    xdg.configFile."sunshine/apps.json".text = builtins.toJSON
    {
      env = "/run/current-system/sw/bin";
      apps = [
        {
           name = "Steam";
           output = "steam.txt";
           detached = ["${pkgs.util-linux}/bin/setsid ${pkgs.steam}/bin/steam steam://open/bigpicture"];
           image-path = "steam.png";
        }
      ];
    };
    xdg.configFile."sunshine/sunshine.conf".text = ''
      global_prep_cmd = [{"do":"${pkgs.libsForQt5.libkscreen}/bin/kscreen-doctor output.1.mode.12","undo":"${pkgs.libsForQt5.libkscreen}/bin/kscreen-doctor output.1.mode.0"}]
      output_name = 1
    '';

    nixpkgs.config = {
      allowUnfree = true;
    };
  };