Sunshine: Difference between revisions

Cdro (talk | contribs)
Correct information about GameStream protocol (Moonlight is an open-source implementation)
imported from old wiki
Line 2: Line 2:


== Install ==
== Install ==
To install Sunshine, you will need to open up firewall ports, install udev rules and provide a setuid wrapper,
 
so that sunshine can capture the display:
 
To install Sunshine and enable it you can use the following snippet:


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{ pkgs, ... }: {
   services.sunshine = {
  environment.systemPackages = [
    pkgs.sunshine
    pkgs.moonlight-qt #for testing purposes.
  ];
   services.udev.packages = [ pkgs.sunshine ]; # allow access to create virtual input interfaces.
  networking.firewall = {
     enable = true;
     enable = true;
     allowedTCPPorts = [ 47984 47989 47990 48010 ];
     autoStart = true;
     allowedUDPPortRanges = [
     capSysAdmin = true;
      { from = 47998; to = 48000; }
    openFirewall = true;
      { from = 8000; to = 8010; }
    ];
   };
   };
  # Prevents this error:
</nowiki>}}
  # Fatal: You must run [sudo setcap cap_sys_admin+p $(readlink -f sunshine)] for KMS display capture to work!
 
  security.wrappers.sunshine = {
 
    owner = "root";
For manual Firewall configuration you can open network ports as shown here:
    group = "root";
 
     capabilities = "cap_sys_admin+p";
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
    source = "${pkgs.sunshine}/bin/sunshine";
networking.firewall = {
  };
  enable = true;
  # Needed for network discovery
  allowedTCPPorts = [ 47984 47989 47990 48010 ];
  services.avahi.enable = true;
  allowedUDPPortRanges = [
  services.avahi.publish.enable = true;
     { from = 47998; to = 48000; }
   services.avahi.publish.userServices = true;
    { from = 8000; to = 8010; }
}
   ];
};
</nowiki>}}
</nowiki>}}