mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-01 07:03:08 +02:00
feat: refactor, update settings for sunshine (#215)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
{
|
||||
# for security reasons, only open the following ports to the network by default.
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
# localsend
|
||||
53317
|
||||
|
||||
4
modules/nixos/desktop/networking/default.nix
Normal file
4
modules/nixos/desktop/networking/default.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
{ mylib, ... }:
|
||||
{
|
||||
imports = mylib.scanPaths ./.;
|
||||
}
|
||||
42
modules/nixos/desktop/networking/remote-desktop.nix
Normal file
42
modules/nixos/desktop/networking/remote-desktop.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
moonlight-qt # moonlight client, for streaming games/desktop from a PC
|
||||
];
|
||||
|
||||
# ===============================================================================
|
||||
#
|
||||
# Sunshine: A self-hosted game stream server for Moonlight(Client).
|
||||
# It's designed for game streaming, but it can be used for remote desktop as well.
|
||||
#
|
||||
# How to use:
|
||||
# 1. setup user via Web Console: <https://localhost:47990/>):
|
||||
# 2. on another machine, connect to sunshine on via moonlight-qt client
|
||||
#
|
||||
# Docs:
|
||||
# https://docs.lizardbyte.dev/projects/sunshine/latest/index.html
|
||||
#
|
||||
# Check Service Status
|
||||
# systemctl --user status sunshine
|
||||
# Check logs
|
||||
# journalctl --user -u sunshine --since "2 minutes ago"
|
||||
#
|
||||
# References:
|
||||
# https://github.com/NixOS/nixpkgs/blob/nixos-25.05/nixos/modules/services/networking/sunshine.nix
|
||||
#
|
||||
# ===============================================================================
|
||||
services.sunshine = {
|
||||
enable = false; # default to false, for security reasons.
|
||||
autoStart = true;
|
||||
capSysAdmin = true; # only needed for Wayland -- omit this when using with Xorg
|
||||
openFirewall = true;
|
||||
settings = {
|
||||
# pc - Only localhost may access the web ui
|
||||
# lan - Only LAN devices may access the web ui
|
||||
origin_web_ui_allowed = "pc";
|
||||
# 2 - encryption is mandatory and unencrypted connections are rejected
|
||||
lan_encryption_mode = 2;
|
||||
wan_encryption_mode = 2;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
# Remote Desktop
|
||||
|
||||
1. **X11**: We have `xrdp` & `ssh -x` for remote desktop access, which works well for most use
|
||||
cases.
|
||||
2. **Wayland**: (not tested)
|
||||
3. `waypipe`: similar to `ssh -X`, transfer wayland data over a ssh connection.
|
||||
4. [rustdesk](https://github.com/rustdesk/rustdesk): a remote desktop client/server written in rust.
|
||||
5. confirmed broken currently:
|
||||
<https://www.reddit.com/r/rustdesk/comments/1912373/rustdesk_on_hyprland/>
|
||||
6. [sunshine server](https://github.com/LizardByte/Sunshine) +
|
||||
[moonlight client](https://github.com/moonlight-stream): It's designed for game streaming, but it
|
||||
can be used for remote desktop as well.
|
||||
7. broken currently: <https://github.com/LizardByte/Sunshine/pull/1977>
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
mylib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = mylib.scanPaths ./.;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
waypipe
|
||||
moonlight-qt # moonlight client, for streaming games/desktop from a PC
|
||||
];
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
# ===============================================================================
|
||||
#
|
||||
# Sunshine: A self-hosted game stream server for Moonlight(Client).
|
||||
# It's designed for game streaming, but it can be used for remote desktop as well.
|
||||
#
|
||||
# How to use(Web Console: <https://localhost:47990/>):
|
||||
# https://docs.lizardbyte.dev/projects/sunshine/en/latest/about/usage.html
|
||||
#
|
||||
# Check Service Status
|
||||
# systemctl --user status sunshine
|
||||
# Check logs
|
||||
# journalctl --user -u sunshine --since "2 minutes ago"
|
||||
#
|
||||
# References:
|
||||
# https://github.com/NixOS/nixpkgs/blob/nixos-25.05/nixos/modules/services/networking/sunshine.nix
|
||||
#
|
||||
# ===============================================================================
|
||||
{
|
||||
services.sunshine = {
|
||||
enable = true;
|
||||
autoStart = true;
|
||||
capSysAdmin = true; # only needed for Wayland -- omit this when using with Xorg
|
||||
openFirewall = true;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user